Re-organize using a proc-macro to support more devices (#728) #1
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
name: Build BSPs | |
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-BSPs | |
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 board '${{ matrix.bsp }}' -c '.boards | .[$board] | .target') | |
rustup target add ${target} | |
rustup component add clippy | |
- name: Setup cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Build ${{ matrix.bsp }} | |
run: | | |
build_invocation=$(cat ./crates.json | jq -Mr --arg board '${{ matrix.bsp }}' -c '.boards | .[$board] | .build') | |
set -ex | |
cd boards/${{ matrix.bsp }} | |
$(${build_invocation}) | |
- name: Clippy ${{ matrix.bsp }} | |
if: ${{ matrix.toolchain == 'nightly' }} | |
run: | | |
set -ex | |
build_invocation=$(cat ./crates.json | jq -Mr --arg board '${{ matrix.bsp }}' -c '.boards | .[$board] | .build') | |
clippy_invocation=$(echo ${build_invocation} | sed 's/cargo build/cargo clippy/g') | |
cd boards/${{ matrix.bsp }} | |
$(${clippy_invocation}) |