-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.79 KB
/
compile-test.yml
File metadata and controls
62 lines (51 loc) · 1.79 KB
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
name: Compile Examples
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board:
- "rp2040:rp2040:rpipico"
- "rp2040:rp2040:rpipico2"
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python Dependencies
run: pip3 install pyserial
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v2
# --- NEW CACHE STEP ---
- name: Cache Arduino Core
id: cache-arduino
uses: actions/cache@v4
with:
path: ~/.arduino15/packages/rp2040
key: ${{ runner.os }}-arduino-pico-core
restore-keys: |
${{ runner.os }}-arduino-pico-core
- name: Install Earle Philhower Core
# This step only runs if the cache wasn't found (cache-hit != 'true')
if: steps.cache-arduino.outputs.cache-hit != 'true'
run: |
arduino-cli core update-index --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
arduino-cli core install rp2040:rp2040 --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
- name: Install Library
run: |
mkdir -p $HOME/Arduino/libraries
ln -s $GITHUB_WORKSPACE $HOME/Arduino/libraries/PicoButtonAsync
- name: Compile All Examples
run: |
for example in examples/*/*.ino; do
echo "Compiling $example..."
arduino-cli compile --fqbn ${{ matrix.board }} "$example"
done