Use test matrix to build examples #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
- version_5_rc0 | |
name: run tests | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: linter | |
run: | | |
pip install cpplint==2.0.0 | |
make lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: install tools | |
run: | | |
pip install platformio==6.1.10 | |
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-latest | |
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" | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: install python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: install tools | |
run: | | |
pip install platformio==6.1.10 | |
- name: build examples | |
run: |- | |
pio ci --board=${{matrix.board}} --lib="src" --lib="examples/${{matrix.example}}"\ | |
examples/${{matrix.example}}/${{matrix.example}}.ino ${{matrix.extra_flags}} | |