1212env :
1313 # Pinned toolchain for linting
1414 ACTION_LINTS_TOOLCHAIN : 1.58.1
15- # Minimum supported Rust version (MSRV)
16- ACTION_MSRV_TOOLCHAIN : 1.58.1
17- CARGO_INCREMENTAL : 0
1815 CARGO_NET_RETRY : 10
1916 CARGO_TERM_COLOR : always
2017 CI : 1
2118 RUSTUP_MAX_RETRIES : 10
2219 RUST_BACKTRACE : short
2320
2421jobs :
25- rust :
26- name : Rust
22+ build-test :
23+ name : Build+Test
2724 runs-on : ubuntu-latest
2825 container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
2926 strategy :
@@ -32,51 +29,52 @@ jobs:
3229 os : [ubuntu-latest]
3330 steps :
3431 - name : Checkout repository
35- uses : actions/checkout@v2
32+ uses : actions/checkout@v3
3633 with :
3734 ref : ${{ github.event.pull_request.head.sha }}
3835 fetch-depth : 20
39- - name : Install Rust toolchain
40- uses : actions-rs/toolchain@v1
41- with :
42- toolchain : stable
43- profile : minimal
44- override : true
36+ - uses : dtolnay/rust-toolchain@stable
4537 - name : Cache Dependencies
46- uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
38+ uses : Swatinem/rust-cache@v2
4739 - name : Compile (no features)
4840 run : cargo test --no-run
4941 - name : Compile (all features)
5042 run : cargo test --no-run --all-features
5143 - name : Test
5244 run : cargo test --all-features -- --nocapture --quiet
53- # TODO: Re-enable this when git master there lands https://github.com/ostreedev/ostree-rs-ext/pull/123
54- # - name: Checkout ostree-rs-ext
55- # uses: actions/checkout@v2
56- # with:
57- # repository: ostreedev/ostree-rs-ext
58- # path: ostree-rs-ext
59- # fetch-depth: 20
60- # - name: Test ostree-rs-ext
61- # run: ./ci/test-ostree-rs-ext.sh
45+ - name : Checkout ostree-rs-ext
46+ uses : actions/checkout@v3
47+ with :
48+ repository : ostreedev/ostree-rs-ext
49+ path : ostree-rs-ext
50+ fetch-depth : 20
51+ - name : Test ostree-rs-ext
52+ run : ./ci/test-ostree-rs-ext.sh
6253 build-minimum-toolchain :
6354 name : " Build, minimum supported toolchain (MSRV)"
6455 runs-on : ubuntu-latest
6556 container : quay.io/coreos-assembler/fcos-buildroot:testing-devel
6657 steps :
6758 - name : Checkout repository
68- uses : actions/checkout@v2
59+ uses : actions/checkout@v3
60+ - name : Detect crate MSRV
61+ shell : bash
62+ run : |
63+ msrv=$(cargo metadata --format-version 1 --no-deps | \
64+ jq -r '.packages | .[0].rust_version')
65+ echo "Crate MSRV: $msrv"
66+ echo "ACTION_MSRV_TOOLCHAIN=$msrv" >> $GITHUB_ENV
6967 - name : Remove system Rust toolchain
7068 run : dnf remove -y rust cargo
71- - name : Install toolchain
72- uses : actions-rs/toolchain@v1
69+ - uses : dtolnay/rust-toolchain@master
7370 with :
7471 toolchain : ${{ env['ACTION_MSRV_TOOLCHAIN'] }}
75- default : true
7672 - name : Cache Dependencies
77- uses : Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
78- - name : cargo build
79- run : cargo build
73+ uses : Swatinem/rust-cache@v2
74+ with :
75+ key : msrv
76+ - name : cargo check
77+ run : cargo check
8078 linting :
8179 name : " Lints, pinned toolchain"
8280 runs-on : ubuntu-latest
8684 uses : actions/checkout@v2
8785 - name : Remove system Rust toolchain
8886 run : dnf remove -y rust cargo
89- - name : Install toolchain
90- uses : actions-rs/toolchain@v1
87+ - uses : dtolnay/rust-toolchain@master
9188 with :
9289 toolchain : ${{ env['ACTION_LINTS_TOOLCHAIN'] }}
93- default : true
9490 components : rustfmt, clippy
9591 - name : cargo fmt (check)
9692 run : cargo fmt -- --check -l
0 commit comments