CI #68
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: CI | |
on: | |
push: | |
branches: ["**"] | |
pull_request: | |
branches: ["**"] | |
schedule: | |
# At 23:25 on Thursday. | |
- cron: "25 23 * * 4" | |
jobs: | |
build-arduino-firmware: | |
# Based on https://legion2.github.io/2020/03/27/from-arduino-builder-to-arduino-cli.html | |
# and https://blog.arduino.cc/2019/11/14/arduino-on-github-actions/ | |
strategy: | |
matrix: | |
runs-on: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: arduino/[email protected] | |
- name: Install platform | |
run: | | |
arduino-cli core update-index | |
arduino-cli core install arduino:avr | |
- name: Compile Sketch | |
run: arduino-cli compile --fqbn arduino:avr:nano | |
check: | |
strategy: | |
matrix: | |
runs-on: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.runs-on }} | |
defaults: | |
run: | |
working-directory: braid-triggerbox-rs | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install update apt repos | |
run: sudo apt-get update && sudo apt-get install -y libudev-dev | |
if: matrix.runs-on == 'ubuntu-latest' | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Run fmt | |
run: cargo fmt -- --check | |
- name: Run clippy | |
run: cargo clippy -- --deny=warnings | |
- name: Run test | |
run: cargo test | |
build-pico-firmware: | |
strategy: | |
matrix: | |
runs-on: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.runs-on }} | |
defaults: | |
run: | |
working-directory: hardware_v3/braid-triggerbox-firmware-pico | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install update apt repos | |
run: sudo apt-get update && sudo apt-get install -y libudev-dev | |
if: matrix.runs-on == 'ubuntu-latest' | |
- name: Setup Rust | |
run: rustup toolchain install stable --profile minimal --no-self-update | |
- name: Install thumbv6m-none-eabi target | |
run: rustup target install thumbv6m-none-eabi | |
- name: Install flip-link | |
run: cargo install flip-link | |
- name: Install elf2uf2-rs | |
run: cargo install --git https://github.com/strawlab/elf2uf2-rs | |
- name: Build ELF | |
run: cargo build --release | |
- name: Make artifacts directory | |
run: mkdir -p artifacts | |
- name: Build UF2 | |
run: elf2uf2-rs target/thumbv6m-none-eabi/release/braid-triggerbox-firmware-pico artifacts/braid-triggerbox-firmware-pico.uf2 | |
- name: Create README.txt | |
run: echo "Hold down the BOOTSEL button when you plug in your Pico. It will appear as a drive onto which you should drag the UF2 file." > artifacts/README.txt | |
- name: Archive UF2 firmware file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: braid-triggerbox-firmware-pico | |
path: hardware_v3/braid-triggerbox-firmware-pico/artifacts/* |