1919
2020jobs :
2121 checks :
22- runs-on : ubuntu-latest
22+ runs-on : ${{ matrix.os }}
23+ strategy :
24+ matrix :
25+ include :
26+ - os : ubuntu-latest
27+ target : x86_64-unknown-linux-gnu
28+ use-cross : false
29+ - os : ubuntu-latest
30+ target : aarch64-unknown-linux-gnu
31+ use-cross : true
32+ - os : macos-latest
33+ target : x86_64-apple-darwin
34+ use-cross : false
35+ - os : macos-latest
36+ target : aarch64-apple-darwin
37+ use-cross : false
38+ - os : windows-latest
39+ target : x86_64-pc-windows-msvc
40+ use-cross : false
2341 steps :
2442 - name : Checkout
2543 uses : actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2644
2745 - name : Install toolchain
2846 uses : dtolnay/rust-toolchain@stable
47+ with :
48+ targets : ${{ matrix.target }}
2949
3050 - name : Cache cargo registry
3151 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
@@ -40,13 +60,24 @@ jobs:
4060 uses : actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4161 with :
4262 path : target
43- key : ${{ runner.os }}-ci-target-${{ hashFiles('**/Cargo.lock') }}
44- restore-keys : ${{ runner.os }}-ci-target-
63+ key : ${{ runner.os }}-ci-${{ matrix. target }} -${{ hashFiles('**/Cargo.lock') }}
64+ restore-keys : ${{ runner.os }}-ci-${{ matrix. target }} -
4565
4666 - name : Install cargo-make
4767 uses : taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2.62.33
4868 with :
4969 tool : cargo-make
5070
71+ - name : Install cross
72+ if : matrix.use-cross == true
73+ uses : taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2.62.33
74+ with :
75+ tool : cross
76+
77+ - name : Run CI task (cross)
78+ if : matrix.use-cross == true
79+ run : cross make ci -- --locked
80+
5181 - name : Run CI task
52- run : cargo make ci
82+ if : matrix.use-cross != true
83+ run : cargo make ci -- --locked
0 commit comments