Simplify CI around qualified runtimes #7
This file contains hidden or 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: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| jobs: | |
| python: | |
| name: Python 3.11 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - run: uv python install 3.11 | |
| - run: uv sync --project pi --frozen --python 3.11 | |
| - run: uv run --project pi --frozen ruff check pi tools stm32/scripts | |
| - run: uv run --project pi --frozen ruff format --check pi tools stm32/scripts | |
| - run: uv run --project pi --frozen mypy pi/src/beamcontrol | |
| - run: uv run --project pi --frozen pytest pi/tests tools/tests --cov=beamcontrol | |
| c-host-tests: | |
| name: Native firmware unit tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: make stm32-test | |
| protocol-contract: | |
| name: Protocol contract (Python <-> C) | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: astral-sh/setup-uv@v5 | |
| - run: make protocol-check | |
| firmware: | |
| name: Firmware nodes 1-3 | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .tools | |
| stm32/.deps | |
| key: toolchain-${{ hashFiles('tools/uv.lock', 'stm32/third_party/libopencm3.lock', 'stm32/third_party/arm-toolchain.lock') }} | |
| - name: Fetch pinned toolchain + libopencm3 | |
| run: make toolchain libopencm3 | |
| - name: Build libopencm3 | |
| run: make libopencm3-build | |
| - name: Build firmware images | |
| run: make firmware-all | |
| - name: Show image sizes | |
| run: | | |
| for image in build/firmware/node-*/*.elf; do | |
| .tools/arm-gnu-toolchain/bin/arm-none-eabi-size "$image" | |
| done | |
| deployment-bundle: | |
| name: Raspberry Pi 5 deployment bundle | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| .tools/uv-cache | |
| .tools/uv-python | |
| key: pi-bundle-${{ runner.arch }}-${{ hashFiles('tools/uv.lock', 'pi/uv.lock', 'pi/pyproject.toml') }} | |
| - name: Build and smoke-test ARM64 offline bundle | |
| run: make pi-bundle-smoke | |
| - name: Generate checksum | |
| run: sha256sum build/beamcontrol-pi-*.tar.gz > build/beamcontrol-pi-SHA256SUMS.txt | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: beamcontrol-pi-${{ github.sha }} | |
| path: | | |
| build/beamcontrol-pi-*.tar.gz | |
| build/beamcontrol-pi-SHA256SUMS.txt | |
| if-no-files-found: error | |
| retention-days: 14 |