Repository navigation
162 lines (134 loc) · 5.54 KB
/
Copy pathci.yml
File metadata and controls
162 lines (134 loc) · 5.54 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: CI
on:
workflow_dispatch:
push:
branches: [main, stackup]
pull_request:
branches: [main, stackup]
jobs:
changes:
runs-on: ubuntu-latest
outputs:
firmware: ${{ steps.filter.outputs.firmware }}
pcb: ${{ steps.filter.outputs.pcb }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
firmware:
- 'src/**'
- 'include/**'
- 'test/**'
- 'platformio.ini'
- 'scripts/firmware_version.py'
- 'scripts/native_coverage_linkflags.py'
- '.github/workflows/ci.yml'
pcb:
- 'PCB/**'
- 'ci/**'
- 'manifest.kdl'
- '.github/workflows/ci.yml'
stackup-check:
needs: changes
if: needs.changes.outputs.pcb == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Checkout Stackup KiCad plugin
uses: actions/checkout@v4
with:
repository: stackup-eda/stackup
ref: v0.3.0
path: stackup-tool
- name: Install Rust 1.96
run: rustup toolchain install 1.96.0 --profile minimal
- name: Check Stackup design
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- check PCB/v1.x/stackup/board.kdl --locked
- name: Check purchasing BOM
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- bom PCB/v1.x/stackup/board.kdl --locked -o /tmp/snips-bom.csv
- name: Check Stackup design (v2)
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- check PCB/v2.x/snips/stackup/board.kdl --locked
- name: Check purchasing BOM (v2)
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- bom PCB/v2.x/snips/stackup/board.kdl --locked -o /tmp/snips-bom-v2.csv
- name: Check Stackup design (XBee carrier)
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- check PCB/v2.x/xbee-carrier/stackup/board.kdl --locked
- name: Check purchasing BOM (XBee carrier)
run: cargo +1.96.0 run --locked --manifest-path ci/stackup/Cargo.toml -- bom PCB/v2.x/xbee-carrier/stackup/board.kdl --locked
- name: Install KiCad 10
run: |
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo add-apt-repository --yes ppa:kicad/kicad-10.0-releases
sudo apt-get update
sudo apt-get install -y --install-recommends kicad
- name: Check PCB sync
run: |
/usr/bin/python3 ci/check_pcb_sync.py PCB/v1.x/snips_controller.kicad_pcb \
--stackup ci/stackup/target/debug/snips-stackup-check \
--plugin-dir stackup-tool/kicad-plugin
- name: Check PCB sync (v2)
run: |
/usr/bin/python3 ci/check_pcb_sync.py PCB/v2.x/snips/snips_controller.kicad_pcb \
--stackup ci/stackup/target/debug/snips-stackup-check \
--plugin-dir stackup-tool/kicad-plugin
- name: Check PCB sync (XBee carrier)
run: |
/usr/bin/python3 ci/check_pcb_sync.py PCB/v2.x/xbee-carrier/xbee_carrier.kicad_pcb \
--stackup ci/stackup/target/debug/snips-stackup-check \
--plugin-dir stackup-tool/kicad-plugin
native-tests:
needs: changes
if: needs.changes.outputs.firmware == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio
key: ${{ runner.os }}-platformio-native-${{ hashFiles('platformio.ini') }}
- name: Install PlatformIO
run: pip install --upgrade platformio gcovr
- name: Run native unit tests
run: pio test -e native
- name: Coverage report
run: |
output=$(gcovr --root . --filter 'src/' --exclude 'src/SnipsController\.ino' --exclude 'src/oled\.cpp' --exclude 'src/rgb_led\.cpp' --exclude 'src/calibration_store\.cpp' --exclude 'src/droid_persistence\.cpp' --exclude 'src/xbee_spi\.cpp' --exclude 'src/xbee_uart\.cpp' --exclude 'src/xbee_control\.cpp' --exclude 'src/display_layout_store\.cpp' --exclude 'src/accelerometer\.cpp' --exclude 'src/power_config_store\.cpp' --print-summary --fail-under-line 90)
status=$?
{
echo '### Coverage (src/, excluding SnipsController.ino and hardware adapters)'
echo '```'
echo "$output"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
echo "$output"
exit $status
esp32s3-build:
needs: changes
if: needs.changes.outputs.firmware == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.platformio
key: ${{ runner.os }}-platformio-esp32s3-${{ hashFiles('platformio.ini') }}
- name: Install PlatformIO
run: pip install --upgrade platformio
- name: Build esp32s3 firmware (V1)
run: pio run -e esp32s3
- name: Build esp32s3_v2 firmware (V2)
run: pio run -e esp32s3_v2