Skip to content

Commit 25fe5ca

Browse files
committed
chore(github): run ci checks on each target environment
1 parent 611e17a commit 25fe5ca

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,42 @@ on:
1111
- v14-alpha
1212

1313
jobs:
14+
build-matrix:
15+
name: Build matrix
16+
runs-on: ubuntu-latest
17+
outputs:
18+
build_matrix: ${{ steps.set-matrix.outputs.build_matrix }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
sparse-checkout: |
24+
.github/workflows/matrix.json
25+
sparse-checkout-cone-mode: false
26+
- id: set-matrix
27+
shell: bash
28+
run: |
29+
if [ "$ACT" == true ]; then
30+
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output '[.[] | select(.RUN_LOCALLY)]' )" >> $GITHUB_OUTPUT
31+
else
32+
echo "build_matrix=$( cat .github/workflows/matrix.json | jq --monochrome-output --compact-output )" >> $GITHUB_OUTPUT
33+
fi
34+
1435
lint-and-test:
15-
name: Lint and test
16-
runs-on: ubuntu-22.04
36+
name: Lint and test (${{ matrix.build.NAME }})
37+
needs: build-matrix
38+
runs-on: ${{ matrix.build.OS }}
39+
strategy:
40+
fail-fast: true
41+
matrix:
42+
build: ${{ fromJson(needs.build-matrix.outputs.build_matrix) }}
1743
steps:
1844
- name: Checkout
1945
uses: actions/checkout@v4
2046
- name: Install rust toolchain
2147
uses: dtolnay/rust-toolchain@stable
2248
with:
49+
targets: ${{ matrix.build.TARGET }}
2350
components: rustfmt, clippy
2451
- name: Set up cargo cache
2552
uses: Swatinem/rust-cache@v2

0 commit comments

Comments
 (0)