|
22 | 22 | RUST_BACKTRACE: 1 |
23 | 23 |
|
24 | 24 | jobs: |
25 | | - cache-deps: |
26 | | - runs-on: ${{ matrix.os }} |
27 | | - strategy: |
28 | | - fail-fast: false |
29 | | - matrix: |
30 | | - os: [windows-latest, ubuntu-latest] |
31 | | - steps: |
32 | | - - run: rustup update --no-self-update |
33 | | - - uses: actions/checkout@v4 |
34 | | - - name: Cache .cargo locked resources |
35 | | - uses: actions/cache@v4 |
36 | | - with: |
37 | | - path: ~/.cargo |
38 | | - key: ${{ runner.os }}-test-cargo-${{ hashFiles('Cargo.lock') }} |
39 | | - - run: cargo fetch |
40 | | - |
41 | 25 | test: |
42 | | - needs: [cache-deps] |
43 | | - name: test ${{ matrix.os }} w/ clang v${{ matrix.version }} |
44 | 26 | strategy: |
45 | 27 | fail-fast: false |
46 | 28 | matrix: |
47 | 29 | os: ['windows-latest', ubuntu-latest] |
48 | | - version: ['17', '16', '15', '14', '13', '12', '11', '10', '9', '8', '7'] |
49 | 30 |
|
50 | 31 | runs-on: ${{ matrix.os }} |
51 | 32 | steps: |
@@ -87,61 +68,152 @@ jobs: |
87 | 68 | if: runner.os == 'Windows' |
88 | 69 | run: choco install ninja |
89 | 70 |
|
90 | | - - name: Install Linux clang dependencies |
91 | | - if: runner.os == 'Linux' |
92 | | - shell: bash |
93 | | - run: | |
94 | | - sudo apt-get update |
95 | | - # First try installing from default Ubuntu repositories before trying LLVM script |
96 | | - if ! sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }}; then |
97 | | - # This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/ |
98 | | - wget https://apt.llvm.org/llvm.sh -O ${{ runner.temp }}/llvm_install.sh |
99 | | - chmod +x ${{ runner.temp }}/llvm_install.sh |
100 | | - if sudo ${{ runner.temp }}/llvm_install.sh ${{ matrix.version }}; then |
101 | | - sudo apt-get install -y clang-format-${{ matrix.version }} clang-tidy-${{ matrix.version }} |
102 | | - fi |
103 | | - fi |
104 | | -
|
105 | | - - name: Install clang-tools |
106 | | - run: | |
107 | | - python -m pip install clang-tools |
108 | | - clang-tools --install ${{ matrix.version }} |
109 | | -
|
110 | | - - name: Cache .cargo locked resources |
111 | | - uses: actions/cache/restore@v4 |
112 | | - with: |
113 | | - path: ~/.cargo |
114 | | - key: ${{ runner.os }}-test-cargo-${{ hashFiles('Cargo.lock') }} |
115 | | - |
116 | | - - name: Collect Coverage |
117 | | - working-directory: cpp-linter-lib |
| 71 | + - name: Fetch .cargo locked resources |
| 72 | + run: cargo fetch |
| 73 | + |
| 74 | + - if: runner.os == 'Linux' |
| 75 | + run: sudo apt-get update |
| 76 | + |
| 77 | + - name: Install clang v7 |
| 78 | + if: matrix.os == 'Linux' |
| 79 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 80 | + with: |
| 81 | + version: '7' |
| 82 | + |
| 83 | + - name: Collect Coverage for clang v7 |
| 84 | + if: matrix.os == 'Linux' |
118 | 85 | env: |
119 | | - CLANG_VERSION: ${{ matrix.version }} |
| 86 | + CLANG_VERSION: '7' |
120 | 87 | run: just test |
121 | 88 |
|
122 | | - - name: Generate Coverage HTML report |
123 | | - working-directory: cpp-linter-lib |
| 89 | + - name: Install clang v8 |
| 90 | + if: matrix.os == 'Linux' |
| 91 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 92 | + with: |
| 93 | + version: '8' |
| 94 | + |
| 95 | + - name: Collect Coverage for clang v8 |
| 96 | + if: matrix.os == 'Linux' |
| 97 | + env: |
| 98 | + CLANG_VERSION: '8' |
| 99 | + run: just test |
| 100 | + |
| 101 | + - name: Install clang v9 |
| 102 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 103 | + with: |
| 104 | + version: '9' |
| 105 | + |
| 106 | + - name: Collect Coverage for clang v9 |
| 107 | + env: |
| 108 | + CLANG_VERSION: '9' |
| 109 | + run: just test |
| 110 | + |
| 111 | + - name: Install clang v10 |
| 112 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 113 | + with: |
| 114 | + version: '10' |
| 115 | + |
| 116 | + - name: Collect Coverage for clang v10 |
| 117 | + env: |
| 118 | + CLANG_VERSION: '10' |
| 119 | + run: just test |
| 120 | + |
| 121 | + - name: Install clang 11 |
| 122 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 123 | + with: |
| 124 | + version: '11' |
| 125 | + |
| 126 | + - name: Collect Coverage for clang v11 |
| 127 | + env: |
| 128 | + CLANG_VERSION: '11' |
| 129 | + run: just test |
| 130 | + |
| 131 | + - name: Install clang 12 |
| 132 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 133 | + with: |
| 134 | + version: '12' |
| 135 | + |
| 136 | + - name: Collect Coverage for clang v12 |
124 | 137 | env: |
125 | | - CLANG_VERSION: ${{ matrix.version }} |
| 138 | + CLANG_VERSION: '12' |
| 139 | + run: just test |
| 140 | + |
| 141 | + - name: Install clang 13 |
| 142 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 143 | + with: |
| 144 | + version: '13' |
| 145 | + |
| 146 | + - name: Collect Coverage for clang v13 |
| 147 | + env: |
| 148 | + CLANG_VERSION: '13' |
| 149 | + run: just test |
| 150 | + |
| 151 | + - name: Install clang 14 |
| 152 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 153 | + with: |
| 154 | + version: '14' |
| 155 | + |
| 156 | + - name: Collect Coverage for clang v14 |
| 157 | + env: |
| 158 | + CLANG_VERSION: '14' |
| 159 | + run: just test |
| 160 | + |
| 161 | + - name: Install clang 15 |
| 162 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 163 | + with: |
| 164 | + version: '15' |
| 165 | + |
| 166 | + - name: Collect Coverage for clang v15 |
| 167 | + env: |
| 168 | + CLANG_VERSION: '15' |
| 169 | + run: just test |
| 170 | + |
| 171 | + - name: Install clang 16 |
| 172 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 173 | + with: |
| 174 | + version: '16' |
| 175 | + |
| 176 | + - name: Collect Coverage for clang v16 |
| 177 | + env: |
| 178 | + CLANG_VERSION: '16' |
| 179 | + run: just test |
| 180 | + |
| 181 | + - name: Install clang 17 |
| 182 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 183 | + with: |
| 184 | + version: '17' |
| 185 | + |
| 186 | + - name: Collect Coverage for clang v17 |
| 187 | + env: |
| 188 | + CLANG_VERSION: '17' |
| 189 | + run: just test |
| 190 | + |
| 191 | + - name: Install clang 18 |
| 192 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 193 | + with: |
| 194 | + version: '18' |
| 195 | + |
| 196 | + - name: Collect Coverage for clang v18 |
| 197 | + env: |
| 198 | + CLANG_VERSION: '18' |
| 199 | + run: just test --run-ignored=all |
| 200 | + |
| 201 | + - name: Generate Coverage HTML report |
126 | 202 | run: just pretty-cov |
127 | 203 |
|
128 | 204 | - name: Upload coverage data |
129 | 205 | uses: actions/upload-artifact@v4 |
130 | 206 | with: |
131 | | - name: HTML_report-${{ runner.os }}-clang_v${{ matrix.version }} |
| 207 | + name: HTML_report-${{ runner.os }} |
132 | 208 | path: target/llvm-cov-pretty |
133 | 209 |
|
134 | 210 | - name: Generate Coverage lcov report |
135 | | - if: matrix.version == '16' && runner.os == 'Linux' |
136 | | - working-directory: cpp-linter-lib |
137 | | - env: |
138 | | - CLANG_VERSION: ${{ matrix.version }} |
139 | | - run: | |
140 | | - cargo llvm-cov report --lcov --output-path lcov.info |
| 211 | + if: runner.os == 'Linux' |
| 212 | + run: just lcov |
141 | 213 |
|
142 | 214 | - uses: codecov/codecov-action@v4 |
143 | | - if: matrix.version == '16' && runner.os == 'Linux' |
| 215 | + if: runner.os == 'Linux' |
144 | 216 | with: |
145 | 217 | token: ${{secrets.CODECOV_TOKEN}} |
146 | | - files: cpp-linter-lib/lcov.info |
| 218 | + files: lcov.info |
147 | 219 | fail_ci_if_error: true # optional (default = false) |
0 commit comments