File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 RUSTFLAGS : -Dwarnings
1414
1515jobs :
16- lint-each-os :
17- strategy :
18- fail-fast : false
19- matrix :
20- os : [ubuntu-24.04, macos-14, windows-2022]
21- feature-args : ['', '-Funstable-mobile-app']
22- include :
23- - feature-args : ' '
24- feature-suffix : ' '
25- - feature-args : ' -Funstable-mobile-app'
26- feature-suffix : ' , mobile-app'
27-
28- name : Lint (${{ matrix.os }}${{ matrix.feature-suffix }})
29- runs-on : ${{ matrix.os }}
30- steps :
31- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
32-
33- - name : Install Rust Toolchain
34- run : rustup toolchain install stable --profile minimal --component clippy --component rustfmt --no-self-update
35-
36- - uses : swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
37-
38- - name : Run Rustfmt
39- run : cargo fmt --all -- --check
40-
41- - name : Run Clippy
42- run : cargo clippy --workspace --tests ${{ matrix.feature-args }}
43-
4416 lint :
45- needs : lint-each-os
46- runs-on : ubuntu-24.04
47- if : always() # Run even if lint-each-os fails
4817 name : Lint
49- steps :
50- - name : Check for lint failures
51- if : contains(needs.lint-each-os.result, 'failure') || contains(needs.lint-each-os.result, 'skipped')
52- run : |
53- echo "Required lint check failed. You need to fix the problem before merging."
54- exit 1
18+ uses : ./.github/workflows/lint.yml
5519
5620 test :
5721 strategy :
Original file line number Diff line number Diff line change 1+ name : Lint
2+
3+ on :
4+ workflow_call :
5+ outputs :
6+ matrix-result :
7+ description : ' Matrix job result'
8+ value : ${{ jobs.lint-summary.result }}
9+
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+ cancel-in-progress : true
13+
14+ jobs :
15+ lint :
16+ strategy :
17+ fail-fast : false
18+ matrix :
19+ os : [ubuntu-24.04, macos-14, windows-2022]
20+ feature-args : ['', '-Funstable-mobile-app']
21+ include :
22+ - feature-args : ' '
23+ feature-suffix : ' '
24+ - feature-args : ' -Funstable-mobile-app'
25+ feature-suffix : ' , mobile-app'
26+
27+ name : ${{ matrix.os }}${{ matrix.feature-suffix }}
28+ runs-on : ${{ matrix.os }}
29+ steps :
30+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
31+
32+ - name : Install Rust Toolchain
33+ run : rustup toolchain install stable --profile minimal --component clippy --component rustfmt --no-self-update
34+
35+ - uses : swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # 2.8.0
36+
37+ - name : Run Rustfmt
38+ run : cargo fmt --all -- --check
39+
40+ - name : Run Clippy
41+ run : cargo clippy --workspace --tests ${{ matrix.feature-args }}
42+
43+ lint-summary :
44+ runs-on : ubuntu-24.04
45+ needs : lint
46+ if : always()
47+ steps :
48+ - name : Check matrix status
49+ id : assert
50+ run : |
51+ if [[ "${{ needs.lint.result }}" == "success" ]]; then
52+ echo "result=success" >> $GITHUB_OUTPUT
53+ else
54+ echo "result=failure" >> $GITHUB_OUTPUT
55+ exit 1
56+ fi
You can’t perform that action at this time.
0 commit comments