Skip to content

Commit f279b6e

Browse files
committed
build examples during ci workflow
1 parent fc6ea83 commit f279b6e

File tree

7 files changed

+93
-58
lines changed

7 files changed

+93
-58
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,90 @@ name: Continuous Integration
33
on: [push]
44

55
jobs:
6-
build:
7-
name: "Build"
6+
build-library:
7+
name: "Build library"
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
11-
- name: Build library ZIP
12-
run: |
13-
mkdir BlenderServoAnimation
14-
cp -R src examples library.properties README.md LICENSE BlenderServoAnimation
15-
zip -r blender_servo_animation_arduino_library BlenderServoAnimation
16-
- name: Archive library ZIP
17-
uses: actions/upload-artifact@v3
18-
with:
19-
name: blender_servo_animation_arduino_library.zip
20-
path: |
21-
blender_servo_animation_arduino_library.zip
10+
- uses: actions/checkout@v3
11+
- name: Create library ZIP
12+
run: |
13+
mkdir BlenderServoAnimation
14+
cp -R src examples library.properties README.md LICENSE BlenderServoAnimation
15+
zip -r blender_servo_animation_arduino_library BlenderServoAnimation
16+
- name: Archive library ZIP
17+
uses: actions/upload-artifact@v3
18+
with:
19+
name: blender_servo_animation_arduino_library.zip
20+
path: |
21+
blender_servo_animation_arduino_library.zip
22+
build-examples:
23+
name: "Build examples"
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
example:
28+
[
29+
AdafruitPCA9685,
30+
LiveMode,
31+
MultiplePCA9685,
32+
StandardServoLib,
33+
SwitchModeButton,
34+
]
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: actions/cache@v3
38+
with:
39+
path: |
40+
~/.cache/pip
41+
~/.platformio/.cache
42+
key: ${{ runner.os }}-pio
43+
- uses: actions/setup-python@v4
44+
with:
45+
python-version: "3.10"
46+
- name: Install PlatformIO Core
47+
run: pip install --upgrade platformio
48+
- name: Build PlatformIO examples
49+
run: |
50+
pio ci --lib=. --project-conf=examples/${{ matrix.example }} \
51+
--board=uno \
52+
--board=esp32dev
53+
env:
54+
PLATFORMIO_CI_SRC: examples/${{ matrix.example }}
2255
lint:
2356
name: "Lint"
2457
runs-on: ubuntu-22.04
2558
steps:
26-
- uses: actions/checkout@v3
27-
- name: Lint with clang-format
28-
uses: jidicula/[email protected]
29-
with:
30-
exclude-regex: 'examples\/.+\/.+\.h'
31-
- name: Lint with arduino-lint
32-
uses: arduino/arduino-lint-action@v1
33-
with:
34-
library-manager: update
59+
- uses: actions/checkout@v3
60+
- name: Lint with clang-format
61+
uses: jidicula/[email protected]
62+
with:
63+
exclude-regex: 'examples\/.+\/.+\.h'
64+
- name: Lint with arduino-lint
65+
uses: arduino/arduino-lint-action@v1
66+
with:
67+
library-manager: update
3568
test:
3669
name: "Test"
3770
runs-on: ubuntu-latest
3871
steps:
39-
- uses: actions/checkout@v3
40-
- name: Cache PlatformIO directory
41-
uses: actions/cache@v3
42-
with:
43-
path: /home/runner/.platformio
44-
key: platformio-dir
45-
- name: Set up Python 3.10
46-
uses: actions/setup-python@v4
47-
with:
48-
python-version: "3.10"
49-
cache: 'pip'
50-
cache-dependency-path: requirements-dev.txt
51-
- name: Install dependencies
52-
run: |
53-
sudo apt-get update
54-
sudo apt-get install --no-install-recommends -y libelf-dev
55-
python -m pip install --upgrade pip
56-
pip install -r requirements-dev.txt
57-
- name: Run tests with platformio
58-
run: |
59-
pio test -e native
72+
- uses: actions/checkout@v3
73+
- name: Cache PlatformIO directory
74+
uses: actions/cache@v3
75+
with:
76+
path: /home/runner/.platformio
77+
key: platformio-dir
78+
- name: Set up Python 3.10
79+
uses: actions/setup-python@v4
80+
with:
81+
python-version: "3.10"
82+
cache: "pip"
83+
cache-dependency-path: requirements-dev.txt
84+
- name: Install dependencies
85+
run: |
86+
sudo apt-get update
87+
sudo apt-get install --no-install-recommends -y libelf-dev
88+
python -m pip install --upgrade pip
89+
pip install -r requirements-dev.txt
90+
- name: Run tests with platformIO
91+
run: |
92+
pio test -e native
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[env]
2+
lib_deps =
3+
adafruit/Adafruit PWM Servo Driver Library@^2.4.1

examples/LiveMode/platformio.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[env]
2+
lib_deps =
3+
arduino-libraries/Servo@^1.1.8
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[env]
2+
lib_deps =
3+
adafruit/Adafruit PWM Servo Driver Library@^2.4.1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[env]
2+
lib_deps =
3+
arduino-libraries/Servo@^1.1.8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[env]
2+
lib_deps =
3+
arduino-libraries/Servo@^1.1.8
4+
mathertel/OneButton@^2.0.3

platformio.ini

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
; PlatformIO Project Configuration File
2-
;
3-
; Build options: build flags, source filter
4-
; Upload options: custom upload port, speed and extra flags
5-
; Library options: dependencies, extra library storages
6-
; Advanced options: extra scripting
7-
;
8-
; Please visit documentation for the other options and examples
9-
; https://docs.platformio.org/page/projectconf.html
10-
111
[env:native]
122
platform = native
133
test_build_src = yes
144
build_flags = -Wno-deprecated-declarations
155
debug_test = test_servo
166
lib_deps =
177
ArduinoFake
18-
arduino-libraries/Servo@^1.1.8
19-
adafruit/Adafruit PWM Servo Driver Library@^2.4.1
20-
Wire
21-
mathertel/OneButton@^2.0.3

0 commit comments

Comments
 (0)