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