-
Notifications
You must be signed in to change notification settings - Fork 8
github/workflows: Use split workflow instead of matrix #29
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| # SPDX-FileCopyrightText: Yalan Zhang <yalzhang@redhat.com> | ||
| # SPDX-FileCopyrightText: Timothée Ravier <tim@siosm.fr> | ||
| # | ||
| # SPDX-License-Identifier: CC0-1.0 | ||
|
|
||
| # Inspired by https://github.com/coreos/repo-templates | ||
|
|
||
| name: "Rust" | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - "main" | ||
| permissions: | ||
| contents: "read" | ||
|
|
||
| # Don't waste job slots on superseded code | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| # Pinned toolchain for linting | ||
| ACTIONS_LINTS_TOOLCHAIN: 1.85.0 | ||
|
|
||
| jobs: | ||
| tests-stable: | ||
| name: "Tests, stable toolchain" | ||
| runs-on: "ubuntu-24.04" | ||
| container: "ghcr.io/confidential-clusters/buildroot:latest" | ||
| steps: | ||
| - name: "Check out repository" | ||
| uses: actions/checkout@v5 | ||
| - name: "Install toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - name: "Cache build artifacts" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "cargo build" | ||
| run: cargo build --all-targets | ||
| - name: "cargo test" | ||
| run: cargo test --all-targets | ||
| tests-release-stable: | ||
| name: "Tests (release), stable toolchain" | ||
| runs-on: "ubuntu-24.04" | ||
| container: "ghcr.io/confidential-clusters/buildroot:latest" | ||
| steps: | ||
| - name: "Check out repository" | ||
| uses: actions/checkout@v5 | ||
| - name: "Install toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - name: "Cache build artifacts" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "cargo build (release)" | ||
| run: cargo build --all-targets --release | ||
| - name: "cargo test (release)" | ||
| run: cargo test --all-targets --release | ||
| tests-release-msrv: | ||
| name: "Tests (release), minimum supported toolchain" | ||
| runs-on: "ubuntu-24.04" | ||
| container: "ghcr.io/confidential-clusters/buildroot:latest" | ||
| steps: | ||
| - name: "Check out repository" | ||
| uses: actions/checkout@v5 | ||
| - name: "Detect crate MSRV" | ||
| run: | | ||
| msrv=$(cargo metadata --format-version 1 --no-deps | \ | ||
| jq -r '.packages[0].rust_version') | ||
| echo "Crate MSRV: $msrv" | ||
| echo "MSRV=$msrv" >> $GITHUB_ENV | ||
| - name: "Install toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ env.MSRV }} | ||
| - name: "Cache build artifacts" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "cargo build (release)" | ||
| run: cargo build --all-targets --release | ||
| - name: "cargo test (release)" | ||
| run: cargo test --all-targets --release | ||
| linting: | ||
| name: "Lints, pinned toolchain" | ||
| runs-on: "ubuntu-24.04" | ||
| container: "ghcr.io/confidential-clusters/buildroot:latest" | ||
| steps: | ||
| - name: "Check out repository" | ||
| uses: actions/checkout@v5 | ||
| - name: "Install toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }} | ||
| components: rustfmt, clippy | ||
| - name: "Cache build artifacts" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "cargo fmt (check)" | ||
| run: cargo fmt -- --check -l | ||
| - name: "cargo clippy (warnings)" | ||
| run: cargo clippy --all-targets -- -D warnings | ||
| tests-other-channels: | ||
| name: "Tests, unstable toolchain" | ||
| runs-on: "ubuntu-24.04" | ||
| container: "ghcr.io/confidential-clusters/buildroot:latest" | ||
| continue-on-error: true | ||
| strategy: | ||
| matrix: | ||
| channel: [beta, nightly] | ||
| steps: | ||
| - name: "Check out repository" | ||
| uses: actions/checkout@v5 | ||
| - name: "Install toolchain" | ||
| uses: dtolnay/rust-toolchain@v1 | ||
| with: | ||
| toolchain: ${{ matrix.channel }} | ||
| - name: "Cache build artifacts" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "cargo build" | ||
| run: cargo build --all-targets | ||
| - name: "cargo test" | ||
| run: cargo test --all-targets | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would need to be
or we relax the MSRV back down to 1.85, #14 removed the constructs that required 1.88
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's start with 1.85.0 as that's what we use in CoreOS as that's what's in some version of RHEL. We can bump it back later.