-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an
xtask
package to simplify our CI workflow (#22)
* Add an option to specify the output directory of the generated project * Remove the `stack-protector` option * Add an `xtask` package to simplify our CI workflow * Update the CI workflow to use `xtask` package and run tests * Remove extraneous HAL initialization from `async_main` * Use `stable` release channel for running tests * Fix a typo in `README.md`
- Loading branch information
1 parent
1d377a9
commit 5f285d1
Showing
9 changed files
with
691 additions
and
77 deletions.
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 |
---|---|---|
|
@@ -24,70 +24,43 @@ concurrency: | |
|
||
jobs: | ||
verify: | ||
name: "${{ matrix.chip }} | ${{ matrix.options }}" | ||
|
||
name: "Check ${{ matrix.chip }}" | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
chip: [ | ||
"esp32", | ||
"esp32c2", | ||
"esp32c3", | ||
"esp32c6", | ||
"esp32h2", | ||
"esp32s2", | ||
"esp32s3", | ||
] | ||
options: [ | ||
"", | ||
"-o alloc", | ||
"-o wifi -o alloc", | ||
"-o ble -o alloc", | ||
"-o embassy", | ||
"-o probe-rs", | ||
"-o stack-protector" | ||
] | ||
# Exclude some combinations that are not supported | ||
exclude: | ||
- chip: "esp32h2" | ||
options: "-o wifi -o alloc" | ||
- chip: "esp32s2" | ||
options: "-o ble -o alloc" | ||
chip: [esp32, esp32c2, esp32c3, esp32c6, esp32h2, esp32s2, esp32s3] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# Rust toolchain for Xtensa: | ||
- if: matrix.chip == 'esp32' || matrix.chip == 'esp32s2' || matrix.chip == 'esp32s3' | ||
- if: ${{ contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | ||
uses: esp-rs/[email protected] | ||
with: | ||
default: true | ||
buildtargets: ${{ matrix.chip }} | ||
ldproxy: false | ||
|
||
# Rust toolchain for RISC-V: | ||
- if: matrix.chip != 'esp32' && matrix.chip != 'esp32s2' && matrix.chip != 'esp32s3' | ||
- if: ${{ !contains(fromJson('["esp32", "esp32s2", "esp32s3"]'), matrix.chip) }} | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | ||
components: clippy,rustfmt,rust-src | ||
|
||
# Rust toolchain for RISC-V: | ||
- if: matrix.chip != 'esp32' && matrix.chip != 'esp32s2' && matrix.chip != 'esp32s3' && matrix.options == '-o stack-protector' | ||
uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
target: riscv32imc-unknown-none-elf,riscv32imac-unknown-none-elf | ||
components: clippy,rustfmt,rust-src | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Generate project | ||
run: cargo run --release -- --chip ${{ matrix.chip }} --headless ${{ matrix.options }} test | ||
- name: Generate and check project | ||
run: cd xtask && cargo run -- check ${{ matrix.chip }} | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Build and check the project | ||
working-directory: test | ||
run: | | ||
cargo fmt -- --check | ||
cargo clippy --no-deps -- -Dwarnings | ||
cargo build --release | ||
- name: Run tests | ||
run: cargo test |
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
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
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
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
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
Oops, something went wrong.