Skip to content

ci: cache per rust version #126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/_build-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
# We do not have a Cargo.lock here, so I hash Cargo.toml
key: ${{ runner.os }}-rust-${{ inputs.rust-version }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: ${{ runner.os }}-cargo-${{ inputs.rust-version }}
- run: cargo version
- name: Code Formatting
if: ${{ inputs.do-style-check }}
Expand Down
46 changes: 30 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,63 +15,77 @@ env:
CARGO_TERM_COLOR: always

jobs:
build_multiboot2_msrv:
name: "build (msrv)"
build_msrv:
name: build (msrv)
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.56.1
do-style-check: false

build_multiboot2_stable:
name: "build (stable)"
build_stable:
name: build (stable)
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: stable
do-style-check: false

build_multiboot2_nightly:
name: "build (nightly)"
build_nightly:
name: build (nightly)
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: nightly
do-style-check: false

build_nostd_multiboot2_msrv:
name: "build no_std (msrv)"
build_nostd_msrv:
name: build no_std (msrv)
needs: build_msrv
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.56.1
do-style-check: false
rust-target: thumbv7em-none-eabihf

build_nostd_multiboot2_stable:
name: "build no_std (stable)"
build_nostd_stable:
name: build no_std (stable)
needs: build_stable
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: stable
do-style-check: false
rust-target: thumbv7em-none-eabihf

build_nostd_multiboot2_nightly:
name: "build no_std (nightly)"
build_nostd_nightly:
name: build no_std (nightly)
needs: build_nightly
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: nightly
do-style-check: false
rust-target: thumbv7em-none-eabihf

style_multiboot2_msrv:
name: "style (msrv)"
style_msrv:
name: style (msrv)
needs: build_msrv
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: 1.56.1
do-style-check: true
do-test: false

style_multiboot2_stable:
name: "style (stable)"
style_stable:
name: style (stable)
needs: build_stable
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: stable
do-style-check: true
do-test: false

style_nightly:
name: style (nightly)
needs: build_nightly
uses: ./.github/workflows/_build-rust.yml
with:
rust-version: nightly
do-style-check: true
do-test: false