Skip to content

Re-organize using a proc-macro to support more devices (#728) #1

Re-organize using a proc-macro to support more devices (#728)

Re-organize using a proc-macro to support more devices (#728) #1

Workflow file for this run

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})