|
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,59 +68,158 @@ 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') }} |
| 71 | + - name: Fetch .cargo locked resources |
| 72 | + run: cargo fetch |
| 73 | + |
| 74 | + - name: Install clang v7 |
| 75 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 76 | + with: |
| 77 | + version: '7' |
115 | 78 |
|
116 | 79 | - name: Collect Coverage |
117 | 80 | working-directory: cpp-linter-lib |
118 | 81 | env: |
119 | | - CLANG_VERSION: ${{ matrix.version }} |
| 82 | + CLANG_VERSION: '7' |
120 | 83 | run: just test |
121 | 84 |
|
122 | | - - name: Generate Coverage HTML report |
| 85 | + - name: Install clang v8 |
| 86 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 87 | + with: |
| 88 | + version: '8' |
| 89 | + |
| 90 | + - name: Collect Coverage |
| 91 | + working-directory: cpp-linter-lib |
| 92 | + env: |
| 93 | + CLANG_VERSION: '8' |
| 94 | + run: just test |
| 95 | + |
| 96 | + - name: Install clang v9 |
| 97 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 98 | + with: |
| 99 | + version: '9' |
| 100 | + |
| 101 | + - name: Collect Coverage |
| 102 | + working-directory: cpp-linter-lib |
| 103 | + env: |
| 104 | + CLANG_VERSION: '9' |
| 105 | + run: just test |
| 106 | + |
| 107 | + - name: Install clang v10 |
| 108 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 109 | + with: |
| 110 | + version: '10' |
| 111 | + |
| 112 | + - name: Collect Coverage |
| 113 | + working-directory: cpp-linter-lib |
| 114 | + env: |
| 115 | + CLANG_VERSION: '10' |
| 116 | + run: just test |
| 117 | + |
| 118 | + - name: Install clang 11 |
| 119 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 120 | + with: |
| 121 | + version: '11' |
| 122 | + |
| 123 | + - name: Collect Coverage |
| 124 | + working-directory: cpp-linter-lib |
| 125 | + env: |
| 126 | + CLANG_VERSION: '11' |
| 127 | + run: just test |
| 128 | + |
| 129 | + - name: Install clang 12 |
| 130 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 131 | + with: |
| 132 | + version: '12' |
| 133 | + |
| 134 | + - name: Collect Coverage |
| 135 | + working-directory: cpp-linter-lib |
| 136 | + env: |
| 137 | + CLANG_VERSION: '12' |
| 138 | + run: just test |
| 139 | + |
| 140 | + - name: Install clang 13 |
| 141 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 142 | + with: |
| 143 | + version: '13' |
| 144 | + |
| 145 | + - name: Collect Coverage |
| 146 | + working-directory: cpp-linter-lib |
| 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 |
| 157 | + working-directory: cpp-linter-lib |
| 158 | + env: |
| 159 | + CLANG_VERSION: '14' |
| 160 | + run: just test |
| 161 | + |
| 162 | + - name: Install clang 15 |
| 163 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 164 | + with: |
| 165 | + version: '15' |
| 166 | + |
| 167 | + - name: Collect Coverage |
| 168 | + working-directory: cpp-linter-lib |
| 169 | + env: |
| 170 | + CLANG_VERSION: '15' |
| 171 | + run: just test |
| 172 | + |
| 173 | + - name: Install clang 16 |
| 174 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 175 | + with: |
| 176 | + version: '16' |
| 177 | + |
| 178 | + - name: Collect Coverage |
| 179 | + working-directory: cpp-linter-lib |
| 180 | + env: |
| 181 | + CLANG_VERSION: '16' |
| 182 | + run: just test |
| 183 | + |
| 184 | + - name: Install clang 17 |
| 185 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 186 | + with: |
| 187 | + version: '17' |
| 188 | + |
| 189 | + - name: Collect Coverage |
123 | 190 | working-directory: cpp-linter-lib |
124 | 191 | env: |
125 | | - CLANG_VERSION: ${{ matrix.version }} |
| 192 | + CLANG_VERSION: '17' |
| 193 | + run: just test |
| 194 | + |
| 195 | + - name: Install clang 18 |
| 196 | + uses: cpp-linter/cpp_linter_rs/install-clang-action@pr-reviews |
| 197 | + with: |
| 198 | + version: '18' |
| 199 | + |
| 200 | + - name: Collect Coverage |
| 201 | + working-directory: cpp-linter-lib |
| 202 | + env: |
| 203 | + CLANG_VERSION: '18' |
| 204 | + run: just test |
| 205 | + |
| 206 | + - name: Generate Coverage HTML report |
| 207 | + working-directory: cpp-linter-lib |
126 | 208 | run: just pretty-cov |
127 | 209 |
|
128 | 210 | - name: Upload coverage data |
129 | 211 | uses: actions/upload-artifact@v4 |
130 | 212 | with: |
131 | | - name: HTML_report-${{ runner.os }}-clang_v${{ matrix.version }} |
| 213 | + name: HTML_report-${{ runner.os }} |
132 | 214 | path: target/llvm-cov-pretty |
133 | 215 |
|
134 | 216 | - name: Generate Coverage lcov report |
135 | | - if: matrix.version == '16' && runner.os == 'Linux' |
| 217 | + if: runner.os == 'Linux' |
136 | 218 | working-directory: cpp-linter-lib |
137 | | - env: |
138 | | - CLANG_VERSION: ${{ matrix.version }} |
139 | 219 | run: just lcov |
140 | 220 |
|
141 | 221 | - uses: codecov/codecov-action@v4 |
142 | | - if: matrix.version == '16' && runner.os == 'Linux' |
| 222 | + if: runner.os == 'Linux' |
143 | 223 | with: |
144 | 224 | token: ${{secrets.CODECOV_TOKEN}} |
145 | 225 | files: cpp-linter-lib/lcov.info |
|
0 commit comments