-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (69 loc) · 2.61 KB
/
build_arduino_examples.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
name: Build Arduino Example Apps
on:
workflow_dispatch:
push:
paths:
- src/**
- examples/arduino/**
- .github/workflows/build_arduino_examples.yml
jobs:
build-examples:
runs-on: ubuntu-latest
strategy:
matrix:
example:
- sniffer
- remote
- receiver
board:
- esp32:esp32:sparkfun_lora_gateway_1-channel
- adafruit:avr:feather32u4
- adafruit:samd:adafruit_feather_m0
include:
# Representative ESP32 board
- board: "esp32:esp32:sparkfun_lora_gateway_1-channel"
cores: "esp32:esp32"
board-url: |
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
board-defines: |
-DOPENRTS_BOARD_SPARKFUN_LORA_GATEWAY -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
# Representative AVR board
- board: "adafruit:avr:feather32u4"
cores: "arduino:avr adafruit:avr"
board-url: |
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
board-defines: |
-DOPENRTS_BOARD_ADAFRUIT_32U4_RFM69 -DOPENRTS_BUTTON_1=0 -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
# Representative SAMD board
- board: "adafruit:samd:adafruit_feather_m0"
cores: "adafruit:samd"
board-url: |
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
board-defines: |
-DOPENRTS_BOARD_ADAFRUIT_M0_RFM69 -DOPENRTS_BUTTON_1=0 -DOPENRTS_BUTTON_2=0 -DOPENRTS_BUTTON_3=0 -DOPENRTS_BUTTON_4=0
steps:
# Checkout the repo
- name: Checkout
uses: actions/checkout@v3
# Install arduino cli
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v1
# Add additional board URL, if required
- name: Add additional board URLs
run: |
arduino-cli config init
arduino-cli config add board_manager.additional_urls ${{ matrix.board-url }}
if: ${{ matrix.board-url }}
# Install cores
- name: Install platform
run: |
arduino-cli core update-index
arduino-cli core install ${{ matrix.cores }}
# Compile the example sketch
- name: Compile sketch
run: |
arduino-cli compile \
--fqbn ${{ matrix.board }} \
--build-property compiler.cpp.extra_flags="${{ matrix.board-defines }}" \
--library="$PWD" \
examples/arduino/${{matrix.example}}