11---
22name : CI
3-
43on :
54 pull_request :
6- branches :
7- - main
5+ branches : [main]
86 types : [opened, synchronize, reopened, ready_for_review]
97 push :
108 branches :
119 - main
12-
1310# run concurrency group for the workflow
1411concurrency :
1512 group : ${{ github.workflow }}-${{ github.ref }}
1613 cancel-in-progress : true
17-
1814jobs :
1915 changed_files :
2016 if : ${{ github.event.pull_request.draft == false }}
2117 runs-on : ubuntu-latest
2218 name : Test changed-files
2319 outputs :
2420 changed-rust-files : ${{ steps.changed-files-yaml.outputs.code_any_changed }}
25- changed-lockfile-files : ${{ steps.changed-files-yaml.outputs.lockfile_any_changed
26- }}
27- changed-docker-files : ${{ steps.changed-files-yaml.outputs.docker_any_changed
28- }}
29- changed-tests-files : ${{ steps.changed-files-yaml.outputs.tests_any_changed
30- }}
21+ changed-lockfile-files : ${{ steps.changed-files-yaml.outputs.lockfile_any_changed }}
22+ changed-docker-files : ${{ steps.changed-files-yaml.outputs.docker_any_changed }}
23+ changed-tests-files : ${{ steps.changed-files-yaml.outputs.tests_any_changed }}
3124 steps :
3225 # Checkout the repository
3326 - name : Checkout Code
3427 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35-
3628 - name : Get changed files
3729 id : changed-files-yaml
3830 uses : tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
5244 tests:
5345 - '**/*.rs'
5446 - tests/**/*.json
55-
5647 ci :
5748 if : ${{ github.event.pull_request.draft == false && always() }}
5849 permissions :
6455 - name : Failed
6556 run : exit 1
6657 if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
67-
6858 msrv :
6959 if : |
7060 ${{ github.event.pull_request.draft == false && github.event_name != 'push' && ( needs.changed_files.outputs.changed-rust-files == 'true' || needs.changed_files.outputs.changed-lockfile-files == 'true') }}
@@ -74,22 +64,19 @@ jobs:
7464 # Checkout the repository
7565 - name : Checkout Code
7666 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
77-
7867 - name : Prepare
7968 id : init
8069 uses : ./.github/actions/prepare
8170
8271 # Get the output of the prepare composite action
8372 - name : Get cache-hit output
8473 run : ' echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
85-
8674 - name : Install cargo hack
8775 uses : taiki-e/install-action@cargo-hack
8876
8977 # Check the minimum supported Rust version
9078 - name : Default features
9179 run : cargo hack check --feature-powerset --locked --rust-version --all-targets
92-
9380 lockfile :
9481 if : |
9582 ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-lockfile-files == 'true' }}
9986 # Checkout the repository
10087 - name : Checkout Code
10188 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
102-
10389 - name : Prepare
10490 id : init
10591 uses : ./.github/actions/prepare
11197 # Check the lockfile
11298 - name : Validate lockfile updates
11399 run : cargo update --locked
114-
115100 rustfmt :
116101 if : |
117102 ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
@@ -121,7 +106,6 @@ jobs:
121106 # Checkout the repository
122107 - name : Checkout Code
123108 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
124-
125109 - name : Prepare
126110 id : init
127111 uses : ./.github/actions/prepare
@@ -133,7 +117,6 @@ jobs:
133117 # Check the formatting of the code
134118 - name : Check formatting
135119 run : cargo fmt --all -- --check
136-
137120 clippy :
138121 if : |
139122 ${{ github.event.pull_request.draft == false && github.event_name != 'push' && needs.changed_files.outputs.changed-rust-files == 'true' }}
@@ -143,46 +126,37 @@ jobs:
143126 # Checkout the repository
144127 - name : Checkout Code
145128 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
146-
147129 - name : Prepare
148130 id : init
149131 uses : ./.github/actions/prepare
150132
151133 # Get the output of the prepare composite action
152134 - name : Get cache-hit output
153135 run : ' echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
154-
155136 - name : Install SARIF tools
156137 run : cargo install clippy-sarif --locked
157-
158138 - name : Install SARIF tools
159139 run : cargo install sarif-fmt --locked
160-
161140 - name : Check
162141 run : >
163142 cargo clippy --all-features --all-targets --message-format=json
164143 | clippy-sarif
165144 | tee clippy-results.sarif
166145 | sarif-fmt
167146 continue-on-error : true
168-
169147 - name : upload sarif artifact
170148 uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
171149 with :
172150 name : clippy-results.sarif
173151 path : clippy-results.sarif
174152 retention-days : 1
175-
176153 - name : Upload
177154 uses : github/codeql-action/upload-sarif@dd196fa9ce80b6bacc74ca1c32bd5b0ba22efca7 # v3.28.3
178155 with :
179156 sarif_file : clippy-results.sarif
180157 wait-for-processing : true
181-
182158 - name : Report status
183- run : cargo clippy --all-features --all-targets -- -D warnings --allow deprecated
184- --locked
185-
159+ run : cargo clippy --all-features --all-targets -- -D warnings --allow deprecated --locked
186160 test :
187161 if : |
188162 ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.changed-tests-files == 'true' }}
@@ -194,64 +168,44 @@ jobs:
194168 # Checkout the repository
195169 - name : Checkout Code
196170 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
197-
198171 - name : Prepare
199172 id : init
200173 uses : ./.github/actions/prepare
201174
202175 # Get the output of the prepare composite action
203176 - name : Get cache-hit output
204177 run : ' echo "Cache hit >>>>>: ${{ steps.init.outputs.cache-hit }}"'
205-
206178 - name : Setup Rust
207179 uses : actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
208180 with :
209181 toolchain : stable
210182 components : llvm-tools-preview
211183 rustflags : ' '
212-
213184 - name : Install cargo hack
214185 uses : taiki-e/install-action@cargo-hack
215-
216186 - name : Install cargo-llvm-cov
217187 uses : taiki-e/install-action@cargo-llvm-cov
218-
219188 - name : Build
220189 run : cargo test --no-run --locked
221190
222191 # Unit tests coverage
223- - name : Run Unit Tests
192+ - name : Generate Unit Coverage Report
224193 env :
225194 LLVM_PROFILE_FILE : unit-%p-%m.profraw
226195 RUSTFLAGS : -Cinstrument-coverage
227- run : cargo hack llvm-cov --no-report --no-default-features --features test-log
228- --locked --lib
229-
230- - name : Generate Unit Coverage Report
231- run : RUST_TEST_THREADS=1 cargo llvm-cov --locked --lcov --output-path unit-lcov.info
232- --lib
196+ run : RUST_TEST_THREADS=1 cargo hack llvm-cov --locked --lcov --output-path unit-lcov.info --lib
233197
234198 # Integration tests coverage
235- - name : Run Integration Tests
199+ - name : Generate Integration Coverage Report
236200 env :
237201 LLVM_PROFILE_FILE : integration-%p-%m.profraw
238202 RUSTFLAGS : -Cinstrument-coverage
239- run : cargo hack llvm-cov --no-report --feature-powerset --locked --test integration
240-
241- - name : Generate Integration Coverage Report
242- run : RUST_TEST_THREADS=1 cargo llvm-cov --locked --lcov --output-path integration-lcov.info
243- --test integration
244-
245- # Properties tests coverage
246- - name : Run Properties Tests
203+ run : RUST_TEST_THREADS=1 cargo hack llvm-cov --locked --lcov --output-path integration-lcov.info --test integration
204+ - name : Generate Properties Coverage Report
247205 env :
248206 LLVM_PROFILE_FILE : properties-%p-%m.profraw
249207 RUSTFLAGS : -Cinstrument-coverage
250- run : cargo hack llvm-cov --no-report --feature-powerset --locked --test properties
251-
252- - name : Generate Properties Coverage Report
253- run : RUST_TEST_THREADS=1 cargo llvm-cov --locked --lcov --output-path properties-lcov.info
254- --test properties
208+ run : RUST_TEST_THREADS=1 cargo hack llvm-cov --locked --lcov --output-path properties-lcov.info --test properties
255209
256210 # Upload unit coverage
257211 - name : Upload Unit Coverage to Codecov
@@ -282,7 +236,6 @@ jobs:
282236 files : properties-lcov.info
283237 flags : properties
284238 fail_ci_if_error : false
285-
286239 docker-scan :
287240 runs-on : ubuntu-latest
288241 needs : [changed_files, ci]
@@ -295,10 +248,8 @@ jobs:
295248 # Checkout the repository
296249 - name : Checkout Code
297250 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
298-
299251 - name : Set up Docker Buildx
300252 uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
301-
302253 - name : Build local container
303254 uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
304255 with :
@@ -307,7 +258,6 @@ jobs:
307258 load : true
308259 file : Dockerfile.development
309260 platforms : linux/amd64
310-
311261 - name : Scan image
312262 uses : anchore/scan-action@7c05671ae9be166aeb155bad2d7df9121823df32 # v6.1.0
313263 with :
0 commit comments