-
Notifications
You must be signed in to change notification settings - Fork 56
97 lines (83 loc) · 2.45 KB
/
test.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
on:
push:
branches:
- master
pull_request:
branches:
- master
- version_5_rc0
name: run tests
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: linter
run: |
pip install cpplint==2.0.0
make lint
test:
runs-on: ubuntu-24.04
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: install tools
run: |
pip install platformio==6.1.16
sudo apt-get update && sudo apt-get install -y lcov
- name: run tests
run: |
cd test
make clean test OPT=-O2
make clean coverage OPT=-O0
- name: Upload coverage to coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
file: test/coverage.lcov
examples:
runs-on: ubuntu-24.04
strategy:
matrix:
board: ["uno", "esp01", "nano33ble", "esp32dev"]
example: ["custom_hal", "morse", "candle", "multiled",
"user_func", "hello", "breathe", "simple_on", "fade_on", "sequence"]
include:
- board: "esp32dev"
extra_flags: --project-option="build_flags = -DLED_BUILTIN=1"
- example: "morse"
extra_libs: --lib="examples/morse"
- board: "nucleo_f401re"
example: "multiled_mbed"
extra_flags: --project-option="framework=mbed"
python_version: "3.11"
ext: cpp
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install python
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python_version || '3.13'}}
- name: install tools
run: |
pip install platformio==6.1.16
- name: build examples
run: |-
# the mbed examples explicitely sets the extension to cpp, default is inp
EXT=${{matrix.ext || 'ino'}}
# the morse example needs --lib examples/morese, so we set the path
# for all examples.
pio ci --board="${{matrix.board}}" \
--lib="src" ${{matrix.extra_libs}} \
${{matrix.extra_flags}} \
"examples/${{matrix.example}}/${{matrix.example}}.${EXT}"