Skip to content

Commit 5e523b9

Browse files
authored
Merge pull request #4 from senseshift/feature/ci
👷 (GitHub): Build examples
2 parents f7e4886 + 3484413 commit 5e523b9

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.github/workflows/arduino-ci.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- "**/*.md"
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- develop
10+
- support/*
11+
paths-ignore:
12+
- "**/*.md"
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: arduino/arduino-lint-action@v1
22+
# with:
23+
# library-manager: update
24+
25+
build-examples:
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
matrix:
30+
fqbn:
31+
- "esp32:esp32:esp32"
32+
- "esp32:esp32:esp32s3"
33+
- "esp32:esp32:esp32c3"
34+
nimble: [ false, true ]
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- uses: arduino/compile-sketches@v1
40+
with:
41+
fqbn: ${{ matrix.fqbn }}
42+
libraries: |
43+
- source-path: ./
44+
- name: NimBLE-Arduino
45+
cli-compile-flags: |
46+
- --build-property
47+
- build.extra_flags="-DBLESERIAL_USE_NIMBLE=${{ matrix.nimble }}"

.github/workflows/platformio-ci.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on:
2+
pull_request:
3+
paths-ignore:
4+
- "**/*.md"
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- develop
10+
- support/*
11+
paths-ignore:
12+
- "**/*.md"
13+
14+
jobs:
15+
platformio:
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ ubuntu-latest ]
22+
example:
23+
- "SerialToSerialBLE"
24+
boards:
25+
- [ esp32dev, esp32-s3-devkitc-1, esp32-c3-devkitm-1 ]
26+
nimble: [ false, true ]
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Cache pip
32+
uses: actions/cache@v4
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
39+
- name: Cache PlatformIO
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.platformio/.cache
44+
./.pio
45+
key: ${{ runner.os }}-pio-${{ hashFiles('**/*.ini') }}
46+
restore-keys: |
47+
${{ runner.os }}-pio-
48+
49+
- name: Set up Python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: "3.9"
53+
54+
- name: Install PlatformIO
55+
run: |
56+
python -m pip install --upgrade pip
57+
pip install --upgrade platformio
58+
pio upgrade --dev
59+
pio pkg update --global
60+
61+
- name: Build example
62+
run: |
63+
pio ci --lib="." --board=${{ join(matrix.boards, ' --board=') }} ${{ matrix.nimble && '--project-option="lib_deps=h2zero/NimBLE-Arduino@^1.4.0"' || '' }}
64+
env:
65+
PLATFORMIO_CI_SRC: "./examples/${{ matrix.example }}/*.ino"
66+
PLATFORMIO_BUILD_FLAGS: "-D BLESERIAL_USE_NIMBLE=${{ matrix.nimble }}"

0 commit comments

Comments
 (0)