@@ -19,18 +19,82 @@ permissions:
1919
2020jobs :
2121
22- common :
23- uses : scm-rs/shared-workflows/.github/workflows/ci.yaml@main
22+ msrv :
23+ runs-on : ubuntu-latest
24+ outputs :
25+ rust-version : ${{ steps.get-version.outputs.rust-version }}
26+ steps :
27+ - uses : actions/checkout@v4
28+ with :
29+ submodules : true
30+ - name : Extract version
31+ id : get-version
32+ run : |
33+ MSRV=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].rust_version')
34+ echo "rust-version=$MSRV" >> $GITHUB_OUTPUT
35+ - name : Show version
36+ run : |
37+ echo "MSRV: ${{ steps.get-version.outputs.rust-version }}"
2438
25- ci :
39+ preflight :
2640 runs-on : ubuntu-latest
41+ steps :
42+ - uses : actions/checkout@v4
43+ with :
44+ submodules : true
45+ - uses : webiny/action-conventional-commits@v1.3.0
46+
47+ - uses : Swatinem/rust-cache@v2
48+ - uses : obi1kenobi/cargo-semver-checks-action@v2
49+
50+ - name : Check formatting
51+ run : cargo fmt --check
52+
53+ check :
2754 needs :
28- - common
29- if : always()
55+ - msrv
56+ - preflight
57+ strategy :
58+ matrix :
59+ rust :
60+ - stable
61+ - ${{ needs.msrv.outputs.rust-version }}
62+ os :
63+ - ubuntu-22.04
64+ - windows-2022
65+ - macos-14
66+ runs-on : ${{ matrix.os }}
3067 steps :
31- - name : Success
32- if : ${{ !(contains(needs.*.result, 'failure')) }}
33- run : exit 0
34- - name : Failure
35- if : ${{ contains(needs.*.result, 'failure') }}
36- run : exit 1
68+ - name : Dump matrix config
69+ run : echo "${{ toJSON(matrix) }}"
70+
71+ - uses : actions/checkout@v4
72+ with :
73+ submodules : true
74+ - uses : Swatinem/rust-cache@v2
75+
76+ - name : Install Rust ${{ matrix.rust }}
77+ run : rustup install ${{ matrix.rust }} --no-self-update --component clippy
78+
79+ - name : Tree
80+ run : cargo +${{ matrix.rust }} tree
81+
82+ - name : Clippy
83+ run : cargo +${{ matrix.rust }} clippy --all-targets --tests --bins --all -- -D warnings
84+
85+ - name : Test
86+ run : cargo +${{ matrix.rust }} test
87+
88+ - name : Install binstall
89+ env :
90+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
91+ run : |
92+ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
93+
94+ - name : Install cargo-all-features
95+ env :
96+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
97+ run : cargo binstall -y cargo-all-features --force
98+
99+ - name : Check (all features)
100+ run : cargo check-all-features
0 commit comments