Skip to content

Commit

Permalink
CI: Add job to show Tier 1 BSPs built on stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ianrrees committed Aug 19, 2024
1 parent cf4ef86 commit 86a4855
Showing 1 changed file with 49 additions and 4 deletions.
53 changes: 49 additions & 4 deletions .github/workflows/build-bsp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
uses: ./.github/actions/list-BSPs

build:
# This name is matched against the project's branch protection settings
name: "build (${{matrix.bsp.name}}, ${{matrix.toolchain}})"
name: "${{matrix.bsp.name}} (Tier ${{matrix.bsp.tier}}, ${{matrix.toolchain}})"
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.toolchain == 'nightly' || matrix.bsp.tier != 1 }}
# There is a subtle difference between continue-on-error and setting
# strategy.fail-fast=false. Both will allow all jobs to run to completion,
# however continue-on-error lets the next workflow stage run regardless of
# failed jobs, strategy.fail-fast=false will skip subsequent stages if any
# job fails.
continue-on-error: true
needs: setup
strategy:
matrix: ${{fromJson(needs.setup.outputs.matrix)}}
Expand All @@ -39,8 +43,11 @@ jobs:
run: |
build_invocation=$(cat ./crates.json | jq -Mr --arg board '${{ matrix.bsp.name }}' -c '.boards | .[$board] | .build')
set -ex
cd boards/${{ matrix.bsp.name }}
pushd boards/${{ matrix.bsp.name }}
$(${build_invocation})
popd
mkdir -p output
touch "output/build"
- name: Clippy ${{ matrix.bsp.name }}
if: ${{ matrix.toolchain == 'nightly' }}
Expand All @@ -50,3 +57,41 @@ jobs:
clippy_invocation=$(echo ${build_invocation} | sed 's/cargo build/cargo clippy/g')
cd boards/${{ matrix.bsp.name }}
$(${clippy_invocation})
- name: Done
uses: actions/upload-artifact@v4
with:
# name needs to be unique in the workspace
name: "${{ matrix.bsp.name }}-${{ matrix.toolchain }}"
path: output

check:
runs-on: ubuntu-latest
needs: build
steps:
# checkout needs to happen first, as it clears the working directory
- name: Checkout sources
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: successful-jobs
- name: Tier 1 BSPs built on stable
run: |
tier_1_bsps=$(cat crates.json | jq -r -c '.boards | with_entries(select(.value.tier == 1)) | keys | join(" ")')
success="true"
for bsp in ${tier_1_bsps}; do
if [ -f successful-jobs/"${bsp}"-stable/build ]; then
echo "${bsp}" built on stable toolchain
else
echo "${bsp}" failed to build on stable toolchain
success="false"
fi
done
if [ ${success} = "true" ]; then
echo "Tier 1 BSPs all built on stable"
else
false
fi

0 comments on commit 86a4855

Please sign in to comment.