-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rework crates.json - Build the HAL for every PAC with every relevant feature - Remove deprecated actions-rs workflows - Deny clippy errors but allow warnings
- Loading branch information
Showing
12 changed files
with
283 additions
and
144 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: 'Compute HAL matrix' | ||
description: 'Prepares the build environment' | ||
|
||
outputs: | ||
matrix: | ||
description: "HAL Build matrix" | ||
value: ${{ steps.compute-matrix.outputs.matrix }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: sudo apt-get install -y jq | ||
shell: bash | ||
- id: compute-matrix | ||
shell: bash | ||
run: | | ||
matrix_json=$(cat crates.json | jq -Mr -c '{ "pac": (.hal_build_variants | keys ), "toolchain": ["stable", "nightly"] }') | ||
echo "matrix=${matrix_json}" >> $GITHUB_OUTPUT |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build HAL | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
- id: set-matrix | ||
uses: ./.github/actions/list-HAL-variants | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.toolchain == 'nightly' }} | ||
needs: setup | ||
strategy: | ||
matrix: ${{fromJson(needs.setup.outputs.matrix)}} | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
run: | | ||
rustup set profile minimal | ||
rustup override set ${{ matrix.toolchain }} | ||
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].target') | ||
rustup target add ${target} | ||
rustup component add clippy | ||
- name: Setup cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Build HAL for ${{ matrix.pac }} | ||
run: | | ||
set -ex | ||
features=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].features | join(",")') | ||
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].target') | ||
cargo build --features=${features} --target=${target} --manifest-path=./hal/Cargo.toml | ||
- name: Clippy HAL for ${{ matrix.pac }} | ||
if: ${{ matrix.toolchain == 'nightly' }} | ||
run: | | ||
set -ex | ||
features=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].features | join(",")') | ||
target=$(cat ./crates.json | jq -Mr --arg pac "${{matrix.pac}}" -c '.hal_build_variants["${{matrix.pac}}"].target') | ||
cargo clippy --features=${features} --target=${target} --manifest-path=./hal/Cargo.toml |
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
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.