Add MPU protections (#8) #148
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: eCTF | |
on: | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- decoder/** | |
jobs: | |
decoder: | |
name: Build Decoder firmware | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up environment | |
run: | | |
python -m pip install ./tools/ | |
python -m pip install -e ./design/ | |
- name: Generate secrets | |
run: python -m ectf25_design.gen_secrets -f global.secrets 1 2 3 | |
- name: Cache Docker images | |
uses: ScribeMD/docker-cache@0.5.0 | |
with: | |
key: docker-${{ runner.os }}-${{ hashFiles('decoder/Dockerfile') }} | |
- name: Build docker image | |
run: docker build -t decoder decoder | |
- name: Build firmware | |
run: docker run --rm -v ./decoder/:/decoder -v ./global.secrets:/global.secrets:ro -v ./deadbeef_build:/out -e DECODER_ID=0xdeadbeef decoder | |
- name: Create artifact | |
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: max78000.bin | |
path: deadbeef_build/max78000.bin | |
- name: Get tag name | |
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | |
id: tag-name | |
run: | | |
echo "tagname=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Release | |
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh release create ${{ steps.tag-name.outputs.tagname }} -t "firmware" -n "Firmware release (${{ steps.tag-name.outputs.tagname }})" | |
gh release upload ${{ steps.tag-name.outputs.tagname }} deadbeef_build/max78000.bin |