-
Notifications
You must be signed in to change notification settings - Fork 8
87 lines (83 loc) · 2.93 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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/*