-
Notifications
You must be signed in to change notification settings - Fork 0
230 lines (198 loc) · 7.49 KB
/
Copy pathboard-make.yml
File metadata and controls
230 lines (198 loc) · 7.49 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
name: Board make
# End-to-end: Freerouting → SES → PCB → KiCad zone refill → DRC gate.
# Fast PR CI still uses the pinned manufacturing board in build.yml.
# This workflow runs on demand, nightly, and when route inputs / stack change.
# To refresh the manufacturing pin after a green run: download board-make-filled
# and run `bun run board:make -- --skip-route --pin` locally (or copy artifacts).
on:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"
pull_request:
paths:
- "ci/artifacts/v3-for-route.kicad_pcb"
- "ci/artifacts/v3-for-route.dsn"
- "ci/artifacts/v3-for-route.kicad_pro"
- "ci/artifacts/fp-lib-table"
- "pcbkit/profiles/lightbar-dock.toml"
- "pcbkit/crates/pcbkit-route/**"
- "pcbkit/crates/pcbkit-cli/**"
- "scripts/board-make.mjs"
- "scripts/route-board-pcbkit.mjs"
- "scripts/ensure-java.mjs"
- "scripts/kicad-env.mjs"
- ".github/workflows/board-make.yml"
push:
branches: [master]
paths:
- "ci/artifacts/v3-for-route.kicad_pcb"
- "ci/artifacts/v3-for-route.dsn"
- "ci/artifacts/v3-for-route.kicad_pro"
- "ci/artifacts/fp-lib-table"
- "pcbkit/profiles/lightbar-dock.toml"
- "pcbkit/crates/pcbkit-route/**"
- "pcbkit/crates/pcbkit-cli/**"
- "scripts/board-make.mjs"
- "scripts/route-board-pcbkit.mjs"
- "scripts/ensure-java.mjs"
- "scripts/kicad-env.mjs"
- ".github/workflows/board-make.yml"
concurrency:
group: board-make-${{ github.ref }}
cancel-in-progress: true
env:
FREEROUTING_VERSION: "2.2.4"
FREEROUTING_JAR: third_party/freerouting/freerouting-2.2.4.jar
jobs:
route:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-java@v4
with:
distribution: temurin
# Freerouting 2.2.4 is classfile 69 → Java 25+.
java-version: "25"
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
pcbkit/target
key: pcbkit-boardmake-${{ runner.os }}-${{ hashFiles('pcbkit/Cargo.lock', 'pcbkit/**/Cargo.toml') }}
- name: Fetch Freerouting JAR
run: |
mkdir -p third_party/freerouting
if [[ ! -f "$FREEROUTING_JAR" ]]; then
curl -fsSL -o "$FREEROUTING_JAR" \
"https://github.com/freerouting/freerouting/releases/download/v${FREEROUTING_VERSION}/freerouting-${FREEROUTING_VERSION}.jar"
fi
ls -la "$FREEROUTING_JAR"
- name: Symlink Java for pcbkit profile
run: |
mkdir -p third_party/java/bin
ln -sfn "$JAVA_HOME/bin/java" third_party/java/bin/java
third_party/java/bin/java -version
- run: bun install --frozen-lockfile
- name: Build pcbkit
run: cargo build --release --manifest-path pcbkit/Cargo.toml -p pcbkit-cli
- name: DSN freshness (placement vs Specctra)
run: bun run dsn:check
- name: Route board (Freerouting + USB repairs)
run: bun run board:make -- --route-only
- name: Upload routed (unfilled) PCB
uses: actions/upload-artifact@v4
with:
name: board-make-routed
path: |
generated/kicad/v3-board-make.kicad_pcb
generated/kicad/v3-board-make.kicad_pro
kicad-fill-drc:
needs: route
runs-on: ubuntu-latest
container:
image: kicad/kicad:10.0
options: --user root
steps:
- uses: actions/checkout@v4
- name: Download routed PCB
uses: actions/download-artifact@v4
with:
name: board-make-routed
path: board-make-routed
- name: Stage board + fp-lib-table
run: |
mkdir -p generated/kicad
if [[ -f board-make-routed/generated/kicad/v3-board-make.kicad_pcb ]]; then
cp board-make-routed/generated/kicad/* generated/kicad/
elif [[ -f board-make-routed/kicad/v3-board-make.kicad_pcb ]]; then
cp board-make-routed/kicad/* generated/kicad/
else
cp board-make-routed/v3-board-make.kicad_pcb generated/kicad/
cp board-make-routed/v3-board-make.kicad_pro generated/kicad/
fi
cp -f ci/artifacts/fp-lib-table generated/kicad/fp-lib-table
ls -la generated/kicad
- name: Zone refill + DRC
working-directory: generated/kicad
run: |
mkdir -p ../reports
# Run beside .kicad_pro + fp-lib-table so project rules / tscircuit lib load.
kicad-cli pcb drc --format json --severity-error --severity-warning \
--refill-zones --save-board \
-o ../reports/v3-board-make-drc.json \
v3-board-make.kicad_pcb
- name: Upload filled PCB + DRC JSON
uses: actions/upload-artifact@v4
with:
name: board-make-filled
path: |
generated/kicad/v3-board-make.kicad_pcb
generated/kicad/v3-board-make.kicad_pro
generated/reports/v3-board-make-drc.json
gate:
needs: [kicad-fill-drc]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
pcbkit/target
key: pcbkit-boardmake-${{ runner.os }}-${{ hashFiles('pcbkit/Cargo.lock', 'pcbkit/**/Cargo.toml') }}
- name: Build pcbkit
run: cargo build --release --manifest-path pcbkit/Cargo.toml -p pcbkit-cli
- name: Download filled board + DRC
uses: actions/download-artifact@v4
with:
name: board-make-filled
path: board-make-out
- name: Normalize artifact layout
run: |
# upload-artifact may strip the common `generated/` prefix.
mkdir -p generated/kicad generated/reports
if [[ -f board-make-out/generated/kicad/v3-board-make.kicad_pcb ]]; then
cp board-make-out/generated/kicad/* generated/kicad/
cp board-make-out/generated/reports/* generated/reports/
else
cp board-make-out/kicad/* generated/kicad/
cp board-make-out/reports/* generated/reports/
fi
ls -la generated/kicad generated/reports
- name: DRC gate (0 unconnected, 0 copper/silk errors)
run: |
./pcbkit/target/release/pcbkit drc-gate \
-j generated/reports/v3-board-make-drc.json \
--max-unconnected 0 \
--max-fatal-errors 0 \
--max-type silk_edge_clearance=0 \
--max-type lib_footprint_issues=0 \
--max-type silk_over_copper=0
- run: bun install --frozen-lockfile
- name: Build circuit-json for assure
run: bun run build:circuit
- name: Assure against freshly made board
run: |
./pcbkit/target/release/pcbkit assure \
-i build/lightbar-dock.circuit.json \
--fab pcbkit/profiles/fab-jlcpcb-2layer.toml \
--golden circuit/assurance/golden-footprints.json \
--pcb generated/kicad/v3-board-make.kicad_pcb \
--skip-manifest \
--bringup circuit/assurance/bringup.toml