Skip to content

Commit 5eb6a08

Browse files
committed
first try at a cross compile action - for main
1 parent bc47b6f commit 5eb6a08

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Cross-compilation Library Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
compile-sketch:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
16+
matrix:
17+
board:
18+
# Uno
19+
# https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt
20+
- fqbn: arduino:avr:mega
21+
# platforms: |
22+
name: arduino:avr
23+
source-url: https://downloads.arduino.cc/packages/package_index.json
24+
25+
# ESP32
26+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
27+
- fqbn: esp32:esp32:esp32
28+
# platforms: |
29+
name: esp32:esp32
30+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
31+
32+
# ESP32-S2
33+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
34+
- fqbn: esp32:esp32:esp32s2
35+
# platforms: |
36+
name: esp32:esp32
37+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
38+
39+
# ESP32-C3
40+
# https://github.com/espressif/arduino-esp32/blob/master/boards.txt
41+
- fqbn: esp32:esp32:esp32c3
42+
# platforms: |
43+
name: esp32:esp32
44+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
45+
46+
# Artemis / Apollo3
47+
# https://github.com/sparkfun/Arduino_Apollo3/blob/main/boards.txt
48+
# - fqbn: SparkFun:apollo3:sfe_artemis_atp
49+
# # platforms: |
50+
# name: SparkFun:apollo3
51+
# source-url: https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json
52+
53+
# ESP8266
54+
# https://github.com/esp8266/Arduino/blob/master/boards.txt
55+
- fqbn: esp8266:esp8266:thingdev
56+
# platforms: |
57+
name: esp8266:esp8266
58+
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
59+
60+
# SAMD21
61+
# https://github.com/arduino/ArduinoCore-samd/blob/master/boards.txt
62+
- fqbn: arduino:samd:mkr1000
63+
# platforms: |
64+
name: arduino:samd
65+
source-url: https://downloads.arduino.cc/packages/package_index.json
66+
67+
# Nano BLE 33 / nRF52840
68+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
69+
- fqbn: arduino:mbed:nano33ble
70+
# platforms: |
71+
name: arduino:mbed
72+
source-url: https://downloads.arduino.cc/packages/package_index.json
73+
74+
# RP2040
75+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
76+
- fqbn: rp2040:rp2040:sparkfun_promicrorp2040
77+
# platforms: |
78+
name: rp2040:rp2040
79+
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
80+
81+
# RP2350
82+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
83+
- fqbn: rp2040:rp2040:sparkfun_promicrorp2350
84+
# platforms: |
85+
name: rp2040:rp2040
86+
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
87+
88+
# STM32
89+
# https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt
90+
- fqbn: STMicroelectronics:stm32:GenF4
91+
# platforms: |
92+
name: STMicroelectronics:stm32
93+
source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
94+
95+
# not using the arduino action to compile everything - it fails to load libraries at a given ref/branch (using toolkit at a specific commit)
96+
steps:
97+
- name: Checkout
98+
uses: actions/checkout@v4
99+
100+
- name: Branch name
101+
run: echo running on branch ${GITHUB_REF##*/}
102+
103+
# Setup Arduino command line - install esp32 and all the libs flux needs
104+
- name: Arduino - Install and setup the Arduino CLI
105+
uses: arduino/setup-arduino-cli@v2
106+
107+
- name: Arduino - Start config file
108+
run: arduino-cli config init --additional-urls ${{ matrix.board.source-url}}
109+
110+
- name: Arduino - Update index
111+
run: arduino-cli core update-index
112+
113+
- name: Arduino - Install platform
114+
run: arduino-cli core install ${{ matrix.board.name}}
115+
116+
- name: Arduino - Install library dependencies
117+
run: arduino-cli lib install "SparkFun Toolkit"
118+
119+
- name: Compile Sketch
120+
run: arduino-cli compile --fqbn ${{ matrix.board.fqbn }} examples/Example1_BasicReadings --library .

0 commit comments

Comments
 (0)