-
Notifications
You must be signed in to change notification settings - Fork 200
42 lines (37 loc) · 1.37 KB
/
build-hal.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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@v4
- 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@v4
- name: Install Rust
run: |
rustup update
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 clippy --features=${features} --target=${target} --manifest-path=./hal/Cargo.toml -- -D warnings