-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (85 loc) · 2.74 KB
/
test.yml
File metadata and controls
89 lines (85 loc) · 2.74 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
name: Test
on: push
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install clang-format
run: sudo apt-get install -y clang-format
- name: Checkout
uses: actions/checkout@v4
with:
submodules: false
- name: Clang-format
run: |
find src/ extras/tests/ -name '*.[hc]' -o -name '*.[hc]pp' | xargs clang-format -i --verbose --style=file
git diff --exit-code
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Configure
run: cmake -DCMAKE_BUILD_TYPE=Debug .
- name: Build
run: cmake --build .
- name: Test
run: ctest --output-on-failure -C Debug .
arduino:
name: Arduino
needs: test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- board: arduino:avr:uno
core: arduino:avr
libraries:
- TimerOne
- TimerThree
- board: teensy:avr:teensy41
core: teensy:avr
libraries:
- Teensy_PWM
- TeensyTimerTool@1.3.1
urls: https://www.pjrc.com/teensy/td_156/package_teensy_index.json
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install arduino-cli
run: curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
- name: Install core
run: arduino-cli core --additional-urls "${{ matrix.urls }}" install ${{ matrix.core }}
- name: Install libraries
if: matrix.libraries
run: arduino-cli lib install ${{ join(matrix.libraries, ' ') }}
- name: Create build script
run: |
cat >/usr/local/bin/compile-example <<END
#!/bin/bash
arduino-cli compile --library . --warnings all -b ${{ matrix.board }} "examples/\$1/\$1.ino"
END
chmod +x /usr/local/bin/compile-example
- name: Build AwfExample
if: matrix.core == 'teensy:avr'
run: compile-example AwfExample
- name: Build BasicExample
run: compile-example BasicExample
- name: Build TeensyPwmExample
if: matrix.core == 'teensy:avr'
run: compile-example TeensyPwmExample
- name: Build TeensyTimerToolExample
if: matrix.core == 'teensy:avr'
run: compile-example TeensyTimerToolExample
- name: Build Timer1Example
run: compile-example Timer1Example
- name: Build Timer3Example
if: matrix.core == 'teensy:avr'
run: compile-example Timer3Example
- name: Build ToneExample
run: compile-example ToneExample