@@ -193,6 +193,88 @@ jobs: |
193 | 193 | done |
194 | 194 | exit 1 |
195 | 195 |
|
| 196 | + # Full netdaq board for the demo, generated from the KiCad source. Same pin |
| 197 | + # as tests/fixtures/README.md. Runs on PRs too, so a break shows up before |
| 198 | + # main. |
| 199 | + demo-board: |
| 200 | + name: Demo board |
| 201 | + runs-on: ubuntu-latest |
| 202 | + container: |
| 203 | + image: kicad/kicad:10.0.6 |
| 204 | + options: --user root |
| 205 | + steps: |
| 206 | + - uses: actions/checkout@v7 |
| 207 | + |
| 208 | + - uses: actions/checkout@v7 |
| 209 | + with: |
| 210 | + repository: Gherkin/netdaq |
| 211 | + ref: e476a90996112e948fbc02550b53fd4876b7232d |
| 212 | + path: netdaq |
| 213 | + |
| 214 | + - uses: actions/checkout@v7 |
| 215 | + with: |
| 216 | + repository: openscopeproject/InteractiveHtmlBom |
| 217 | + ref: 5c192e794cd66fde04bab11810601b711bf8581b |
| 218 | + path: ibom |
| 219 | + |
| 220 | + # pcbnew prints over a thousand assert warnings to stderr. Keep them out |
| 221 | + # of the log unless the run fails. |
| 222 | + - name: Generate board JSON |
| 223 | + env: |
| 224 | + IBOM_PATH: ${{ github.workspace }}/ibom |
| 225 | + run: | |
| 226 | + python3 tools/make_fixture.py netdaq/netdaq.kicad_pcb out/netdaq.json 2> make_fixture.log \ |
| 227 | + || { cat make_fixture.log; exit 1; } |
| 228 | + test -s out/netdaq.json |
| 229 | +
|
| 230 | + - uses: actions/upload-artifact@v7 |
| 231 | + with: |
| 232 | + name: demo-board |
| 233 | + path: out/netdaq.json |
| 234 | + retention-days: 7 |
| 235 | + |
| 236 | + # Demo on GitHub Pages (#4): the self-contained viewer with the full netdaq |
| 237 | + # board inlined. Pages source must be set to "GitHub Actions". |
| 238 | + pages: |
| 239 | + name: Publish demo |
| 240 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 241 | + needs: [checks, smoke, build, browser, demo-board] |
| 242 | + runs-on: ubuntu-latest |
| 243 | + permissions: |
| 244 | + contents: read |
| 245 | + pages: write |
| 246 | + id-token: write |
| 247 | + concurrency: |
| 248 | + group: pages |
| 249 | + cancel-in-progress: false |
| 250 | + environment: |
| 251 | + name: github-pages |
| 252 | + url: ${{ steps.deploy.outputs.page_url }} |
| 253 | + steps: |
| 254 | + - uses: actions/checkout@v7 |
| 255 | + |
| 256 | + - uses: actions/setup-python@v7 |
| 257 | + with: |
| 258 | + python-version: '3.12' |
| 259 | + |
| 260 | + - uses: actions/download-artifact@v8 |
| 261 | + with: |
| 262 | + name: demo-board |
| 263 | + path: board/ |
| 264 | + |
| 265 | + - name: Build demo page |
| 266 | + run: | |
| 267 | + mkdir -p site |
| 268 | + python generate.py board/netdaq.json -o site/index.html |
| 269 | + test -s site/index.html |
| 270 | +
|
| 271 | + - uses: actions/upload-pages-artifact@v5 |
| 272 | + with: |
| 273 | + path: site/ |
| 274 | + |
| 275 | + - id: deploy |
| 276 | + uses: actions/deploy-pages@v5 |
| 277 | + |
196 | 278 | # main pushes publish :latest, v* tags publish the version. Both get :sha-<short>. |
197 | 279 | publish: |
198 | 280 | name: Publish image |
|