This repository was archived by the owner on Aug 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (126 loc) · 4.04 KB
/
Copy pathci.yml
File metadata and controls
146 lines (126 loc) · 4.04 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: CI
on:
push:
branches: [ main, master ]
tags: ['v*']
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
source-audit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Audit production sources
run: |
if rg -n '\bthrow\b|std::abort\(' src; then
echo "Embedded safety audit failed"
exit 1
fi
build-examples:
runs-on: ubuntu-latest
needs: source-audit
strategy:
fail-fast: false
matrix:
board: [esp32dev, esp32-s3-devkitc-1, esp32-c3-devkitm-1, esp32-p4-evboard]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio-pioarduino-6.1.19-${{ hashFiles('**/library.json') }}
restore-keys: |
${{ runner.os }}-platformio-pioarduino-6.1.19-
- name: Install PIOArduino Core
run: python -m pip install --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.19.zip
- name: Install PIOArduino ESP32 Platform
run: pio pkg install -g -p https://github.com/pioarduino/platform-espressif32.git
- name: Build library examples (ESP32 Arduino)
run: |
set -e
for d in examples/*; do
if [ -d "$d" ]; then
echo "Building $d on ${{ matrix.board }} via PlatformIO CI"
# Force C++17 for this project to satisfy library requirements
pio ci "$d" \
--board ${{ matrix.board }} \
--lib="." \
--project-option "platform=https://github.com/pioarduino/platform-espressif32.git" \
--project-option "build_unflags=-std=gnu++11" \
--project-option "build_flags=-std=gnu++17"
fi
done
arduino-cli:
runs-on: ubuntu-latest
needs: source-audit
strategy:
fail-fast: false
matrix:
board:
- fqbn: esp32:esp32:esp32
name: esp32dev
- fqbn: esp32:esp32:esp32s3
name: esp32-s3-devkitc-1
- fqbn: esp32:esp32:esp32c3
name: esp32-c3-devkitm-1
- fqbn: esp32:esp32:esp32p4
name: esp32-p4-evboard
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: Install ESP32 core
run: |
arduino-cli core update-index
arduino-cli core install esp32:esp32
- name: Add local library to sketchbook
run: |
set -e
SKETCHBOOK_DIR="${HOME}/Arduino"
mkdir -p "$SKETCHBOOK_DIR/libraries/ESPWorker"
rsync -a --delete --exclude ".git" ./ "$SKETCHBOOK_DIR/libraries/ESPWorker/"
- name: Build examples (${{ matrix.board.name }})
env:
FQBN: ${{ matrix.board.fqbn }}
run: |
set -e
for d in examples/*; do
if [ -d "$d" ]; then
echo "Compiling $d"
arduino-cli compile --fqbn "$FQBN" "$d"
fi
done
package-library:
runs-on: ubuntu-latest
needs:
- build-examples
- arduino-cli
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install PIOArduino Core
run: python -m pip install --upgrade https://github.com/pioarduino/platformio-core/archive/refs/tags/v6.1.19.zip
- name: Pack library (PlatformIO)
run: |
mkdir -p dist
pio pkg pack --output dist
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: espworker-${{ github.sha }}
path: dist/*