-
Notifications
You must be signed in to change notification settings - Fork 8
110 lines (96 loc) · 5.26 KB
/
LibraryBuildWithScript.yml
File metadata and controls
110 lines (96 loc) · 5.26 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
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# LibraryBuildWithScript.yml
# Github workflow script to test compile all examples of an Arduino library repository.
#
# Copyright (C) 2020-2022 Armin Joachimsmeyer
# https://github.com/ArminJo/Github-Actions
#
# Before being able to push to my .github\workflows directories,
# I had to create a new personal token with workflow enabled at https://github.com/settings/tokens
# This is the name of the workflow, visible on GitHub UI.
name: LibraryBuildWithScript
on:
workflow_dispatch: # To run it manually
description: 'manual build check'
push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
paths:
- '**.ino'
- '**.cpp'
- '**.h'
- '**LibraryBuildWithScript.yml'
pull_request:
jobs:
build:
name: ${{ matrix.arduino-boards-fqbn }} - test compiling examples
runs-on: ubuntu-latest # I picked Ubuntu to use shell scripts.
env:
# Comma separated list without double quotes around the list.
REQUIRED_LIBRARIES: #ATtinySerialOut # is loaded as custom library below
strategy:
matrix:
# The matrix will produce one job for each configuration parameter of type `arduino-boards-fqbn`
# In the Arduino IDE, the fqbn is printed in the first line of the verbose output for compilation as parameter -fqbn=... for the "arduino-builder -dump-prefs" command
#
# Examples: arduino:avr:uno, arduino:avr:leonardo, arduino:avr:nano, arduino:avr:mega
# arduino:sam:arduino_due_x, arduino:samd:arduino_zero_native"
# ATTinyCore:avr:attinyx5:chip=85,clock=1internal, digistump:avr:digispark-tiny, digistump:avr:digispark-pro
# STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8
# esp8266:esp8266:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80
# You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
#############################################################################################################
arduino-boards-fqbn:
- arduino:avr:uno
- arduino:avr:uno|All-DEBUG
- digistump:avr:digispark-tiny:clock=clock1
- ATTinyCore:avr:attinyx5:chip=85,clock=1internal
# Specify parameters for each board.
# With sketches-exclude you may exclude specific examples for a board. Use a comma separated list.
#############################################################################################################
include:
- arduino-boards-fqbn: arduino:avr:uno|All-DEBUG # Uno board with -DDEBUG for all examples
sketches-exclude: 50Hz # Comma separated list of example names to exclude in build
build-properties:
All: -DDEBUG -DINFO
WhistleSwitch: -DDEBUG
- arduino-boards-fqbn: digistump:avr:digispark-tiny:clock=clock1 # ATtiny85 board @1 MHz
platform-url: https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
sketch-names: SimpleFrequencyDetector.ino,50Hz.ino # Comma separated list of sketch names (without path, but with extension) or patterns to use in build
build-properties:
All: -DINFO
# WhistleSwitch: is 6 bytes too big :-(
- arduino-boards-fqbn: ATTinyCore:avr:attinyx5:chip=85,clock=1internal
platform-url: https://felias-fogg.github.io/downloads/package_debug_enabled_index.json
# Do not cancel all jobs / architectures if one job fails
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@master
- name: Checkout master version of ATtinySerialOut
uses: actions/checkout@master
with:
repository: ArminJo/ATtinySerialOut
ref: master
path: CustomLibrary # must contain string "Custom"
# - name: Checkout second custom library # This name must be different from th one above
# uses: actions/checkout@vmaster
# with:
# repository: ArminJo/Arduino-Utils
# ref: master
# path: SecondCustomLibrary # This path must differ from the one above, and must also contain string "Custom"
# Use the arduino-test-compile script
- name: Compile all examples using the bash script arduino-test-compile.sh
env:
# Passing parameters to the script by setting the appropriate ENV_* variables.
ENV_ARDUINO_BOARD_FQBN: ${{ matrix.arduino-boards-fqbn }}
ENV_PLATFORM_URL: ${{ matrix.platform-url }}
ENV_REQUIRED_LIBRARIES: ${{ env.REQUIRED_LIBRARIES }} # is empty here
ENV_SKETCHES_EXCLUDE: ${{ matrix.sketches-exclude }}
ENV_BUILD_PROPERTIES: -DDEBUG,-DINFO # wrong input syntax is converted internally to right one '{ "All": "-DDEBUG -DINFO" }'
ENV_SKETCH_NAMES: ${{ matrix.sketch-names }}
ENV_SKETCH_NAMES_FIND_START: . # start search at repository base
ENV_DEBUG_INSTALL: true
ENV_DEBUG_COMPILE: true
run: |
wget --quiet https://raw.githubusercontent.com/ArminJo/arduino-test-compile/master/arduino-test-compile.sh
ls -l arduino-test-compile.sh
chmod +x arduino-test-compile.sh
./arduino-test-compile.sh