-
Notifications
You must be signed in to change notification settings - Fork 151
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
Update cargo regress tool and move CI #905
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 contains 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 |
---|---|---|
|
@@ -54,53 +54,47 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: [check] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Options are all, none, strict and const | ||
include: | ||
- { rust: stable, vendor: Atmel, options: all } | ||
- { rust: stable, vendor: Atmel, options: "" } | ||
- { rust: stable, vendor: Freescale, options: all } | ||
- { rust: stable, vendor: Freescale, options: "" } | ||
- { rust: stable, vendor: Fujitsu, options: "" } | ||
- { rust: stable, vendor: Fujitsu, options: "--atomics" } | ||
- { rust: stable, vendor: GD32, options: all } | ||
- { rust: stable, vendor: GD32, options: "" } | ||
- { rust: stable, vendor: Holtek, options: all } | ||
- { rust: stable, vendor: Holtek, options: "" } | ||
- { rust: stable, vendor: Microchip, options: "" } | ||
- { rust: stable, vendor: Microchip, options: "--atomics" } | ||
- { rust: stable, vendor: Nordic, options: all } | ||
- { rust: stable, vendor: Nordic, options: "" } | ||
- { rust: stable, vendor: Nuvoton, options: "" } | ||
- { rust: stable, vendor: Nuvoton, options: "--atomics" } | ||
- { rust: stable, vendor: NXP, options: all } | ||
- { rust: stable, vendor: NXP, options: "" } | ||
- { rust: stable, vendor: RISC-V, options: "" } | ||
- { rust: stable, vendor: RISC-V, options: "--atomics" } | ||
- { rust: stable, vendor: SiliconLabs, options: all } | ||
- { rust: stable, vendor: SiliconLabs, options: "" } | ||
- { rust: stable, vendor: Spansion, options: "" } | ||
- { rust: stable, vendor: Spansion, options: "--atomics" } | ||
- { rust: stable, vendor: STMicro, options: "" } | ||
- { rust: stable, vendor: STMicro, options: "--atomics" } | ||
- { rust: stable, vendor: STM32-patched, options: "--strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } | ||
- { rust: stable, vendor: Toshiba, options: all } | ||
- { rust: stable, vendor: Toshiba, options: "" } | ||
# Test MSRV | ||
- { rust: 1.76.0, vendor: Nordic, options: "" } | ||
# Use nightly for architectures which don't support stable | ||
- { rust: nightly, vendor: MSP430, options: "--atomics" } | ||
- { rust: nightly, vendor: MSP430, options: "" } | ||
# Workaround for _1token0 | ||
- { rust: nightly-2024-09-25, vendor: Espressif, options: "--atomics --ident-formats-theme legacy" } | ||
- { rust: nightly-2024-09-25, vendor: Espressif, options: "--ident-format register:::Reg" } | ||
- { vendor: Atmel } | ||
- { vendor: Atmel, options: "-- --strict --atomics" } | ||
- { vendor: Freescale } | ||
- { vendor: Freescale, options: "-- --strict --atomics" } | ||
- { vendor: Fujitsu } | ||
- { vendor: Fujitsu, options: "-- --atomics" } | ||
- { vendor: Holtek } | ||
- { vendor: Holtek, options: "-- --strict --atomics" } | ||
- { vendor: Atmel } | ||
- { vendor: Atmel, options: "-- --strict --atomics" } | ||
- { vendor: Microchip } | ||
- { vendor: Microchip, options: "-- --atomics" } | ||
- { vendor: Nordic } | ||
- { vendor: Nordic, options: "-- --strict --atomics" } | ||
- { vendor: Nuvoton } | ||
- { vendor: Nuvoton, options: "-- --atomics" } | ||
- { vendor: NXP } | ||
- { vendor: NXP, options: "-- --strict --atomics" } | ||
- { vendor: SiFive } | ||
- { vendor: SiFive, options: "-- --atomics" } | ||
- { vendor: SiliconLabs, options: "" } | ||
- { vendor: SiliconLabs, options: "-- --strict --atomics" } | ||
- { vendor: Spansion } | ||
- { vendor: Spansion, options: "-- --atomics" } | ||
- { vendor: STMicro } | ||
- { vendor: STMicro, options: "-- --atomics" } | ||
- { vendor: STMicro, options: "-- --strict -f enum_value::p: --max-cluster-size --atomics --atomics-feature atomics --impl-debug --impl-defmt defmt" } | ||
- { vendor: Toshiba } | ||
- { vendor: Toshiba, options: "-- --strict --atomics" } | ||
- { vendor: TexasInstruments } | ||
- { vendor: TexasInstruments, options: "-- --atomics" } | ||
- { vendor: Espressif } | ||
- { vendor: Espressif, options: "-- --atomics" } | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
@@ -109,13 +103,25 @@ jobs: | |
run: | | ||
cargo install svd2rust --path . | ||
|
||
- name: Run CI script for `${{ matrix.vendor }}` under rust `${{ matrix.rust }}` with options=`${{ matrix.options }}` | ||
env: | ||
VENDOR: ${{ matrix.vendor }} | ||
OPTIONS: ${{ matrix.options }} | ||
COMMAND: check | ||
RUST_TOOLCHAIN: ${{ matrix.rust }} | ||
run: bash ci/script.sh | ||
- name: Run regression tool | ||
run: cargo regress tests -m ${{ matrix.vendor }} ${{ matrix.options }} | ||
|
||
ci-msrv-check: | ||
runs-on: ubuntu-latest | ||
needs: [check] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Self install | ||
run: | | ||
cargo install svd2rust --path . | ||
|
||
# Install the MSRV toolchain | ||
- uses: dtolnay/[email protected] | ||
- name: Run reression tool with MSRV | ||
# The MSRV only applies to the generated crate. The regress tool should still be run with | ||
# stable. | ||
run: cargo +stable regress tests --toolchain 1.76.0 -m Nordic -- --strict --atomics | ||
|
||
ci-clippy: | ||
runs-on: ubuntu-latest | ||
|
This file contains 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ edition = "2021" | |
name = "svd2rust-regress" | ||
version = "0.1.0" | ||
authors = ["James Munns <[email protected]>", "The svd2rust developers"] | ||
rust-version = "1.82.0" | ||
|
||
[dependencies] | ||
clap = { version = "4.1", features = ["color", "derive", "string", "env"] } | ||
|
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.
we could use a
job
which would convert the matrix in this file to
however, that wouldn't test different command flags. So maybe we shouldn't do that and instead just have a single job to test all defined test targets in
svd2rust-regress
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.
How would the input specification via a different job help? Wouldn´t one command mean that there are no individual CI jobs for the architecture and flag options anymore? I think this is a good thing in the current setup.. I tried to preserve the old setup here.
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.
I do this in cross-rs, where I have a targets.toml that populate the CI automatically through a ci job to filter targets.
The input basically expands to a list of targets, not just a single target in a list
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 probably be useful to make running the tests as they are done in the CI locally, even though it makes the CI chain a bit more complex.. But it might be better for a different PR?