-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (92 loc) · 2.62 KB
/
ci.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
name: Continuous Integration
on: [push]
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create library ZIP
run: |
mkdir BlenderServoAnimation
cp -R src examples library.properties README.md LICENSE BlenderServoAnimation
zip -r blender_servo_animation_arduino_library BlenderServoAnimation
- name: Archive library ZIP
uses: actions/upload-artifact@v3
with:
name: blender_servo_animation_arduino_library.zip
path: |
blender_servo_animation_arduino_library.zip
build-examples:
name: "Build examples"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example:
[
AdafruitPCA9685,
MultiplePCA9685,
MultipleScenes,
MultipleScenesSD,
SDAnimation,
SerialLiveMode,
StandardServoLib,
SwitchModeButton,
WebSocketLiveMode,
]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install PlatformIO Core
run: pip install --upgrade platformio
- name: Build PlatformIO examples
run: |
cd examples/${{ matrix.example }}
pio run
lint:
name: "Lint"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Lint with clang-format
uses: jidicula/clang-format-action@v4.10.2
with:
exclude-regex: 'examples\/.+\/.+\.h'
- name: Lint with arduino-lint
uses: arduino/arduino-lint-action@v1
with:
library-manager: update
test:
name: "Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache PlatformIO directory
uses: actions/cache@v3
with:
path: /home/runner/.platformio
key: platformio-dir
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: requirements-dev.txt
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y libelf-dev
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests with platformIO
run: |
pio test -e native