1010 CARGO_TERM_COLOR : always
1111
1212jobs :
13+ build-core-tooling-matrix :
14+ name : Build Rust version matrix
15+ runs-on : ubuntu-latest
16+ outputs :
17+ versions : ${{ steps.versions.outputs.versions }}
18+
19+ steps :
20+ - name : Install stable Rust toolchain
21+ uses : dtolnay/rust-toolchain@stable
22+
23+ - name : Compute last 3 stable Rust versions
24+ id : versions
25+ shell : bash
26+ run : |
27+ stable="$(rustc --version --verbose | sed -n 's/^release: //p')"
28+ major="${stable%%.*}"
29+ remainder="${stable#${major}.}"
30+ minor="${remainder%%.*}"
31+
32+ previous_one=$((minor - 1))
33+ previous_two=$((minor - 2))
34+
35+ if (( previous_two < 0 )); then
36+ echo "Unable to compute previous versions from stable release '${stable}'" >&2
37+ exit 1
38+ fi
39+
40+ versions="$(printf '["%s.%s","%s.%s","%s.%s"]' "$major" "$minor" "$major" "$previous_one" "$major" "$previous_two")"
41+ echo "versions=${versions}" >> "$GITHUB_OUTPUT"
42+ echo "Using Rust versions: ${versions}"
43+
44+ build-core-tooling-compat :
45+ name : Build core tooling (Rust ${{ matrix.rust }})
46+ needs : build-core-tooling-matrix
47+ runs-on : ubuntu-latest
48+ strategy :
49+ fail-fast : false
50+ matrix :
51+ rust : ${{ fromJson(needs.build-core-tooling-matrix.outputs.versions) }}
52+
53+ steps :
54+ - name : Checkout repository
55+ uses : actions/checkout@v4
56+
57+ - name : Install Rust toolchain
58+ uses : dtolnay/rust-toolchain@stable
59+ with :
60+ toolchain : ${{ matrix.rust }}
61+
62+ - name : Cache cargo registry & build artifacts
63+ uses : actions/cache@v4
64+ with :
65+ path : |
66+ ~/.cargo/registry
67+ ~/.cargo/git
68+ target
69+ key : ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
70+ restore-keys : |
71+ ${{ runner.os }}-cargo-${{ matrix.rust }}-
72+ ${{ runner.os }}-cargo-
73+
74+ - name : Build sanctifier-core and sanctifier-cli
75+ run : cargo check -p sanctifier-core -p sanctifier-cli
76+
1377 build-and-test :
1478 name : Build & Test sanctifier-cli
1579 runs-on : ubuntu-latest
1983 uses : actions/checkout@v4
2084
2185 - name : Install stable Rust toolchain
22- uses : dtolnay/rust-toolchain@stable
86+ uses : dtolnay/rust-toolchain@master
2387 with :
2488 toolchain : stable
2589 components : rustfmt, clippy
@@ -39,10 +103,7 @@ jobs:
39103 run : cargo fmt --check
40104
41105 - name : Run Clippy
42- run : cargo clippy --workspace --all-targets --all-features -- -D warnings
43106
44- - name : Run tests
45- run : cargo test --workspace --all-features
46107
47108 - name : Build release binary
48109 run : cargo build --release --locked -p sanctifier-cli
0 commit comments