-
-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.45 KB
/
zig-build.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
name: Zig Build
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
board: [pico, pico_w, pico2, pico2_w, pico2-riscv, pico2-riscv_w]
optimize: [Debug, ReleaseSafe, ReleaseFast, ReleaseSmall]
zig: [latest]
steps:
- uses: actions/checkout@v4
- name: Setup Zig Compiler
uses: mlugg/[email protected]
with:
version: ${{ matrix.zig }}
- name: Cache Toolchains
id: cache-toolchains
uses: actions/cache@v4
with:
path: ./build/${{ matrix.board }}/${{ matrix.optimize }}/toolchain
key: ${{ matrix.board }}-toolchain
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: ./build/${{ matrix.board }}/${{ matrix.optimize }}/_deps
key: ${{ matrix.board }}-deps
- name: Build
run: zig build -Dboard=${{ matrix.board }} -Doptimize=${{ matrix.optimize }} -Dbuild_dir=./build/${{ matrix.board }}/${{ matrix.optimize }}
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.board }}-${{ matrix.optimize }}
path: "./build/${{ matrix.board }}/${{ matrix.optimize }}\n!./build/${{ matrix.board }}/${{ matrix.optimize }}/_deps\n!./build/${{ matrix.board }}/${{ matrix.optimize }}/toolchain"