Skip to content

Commit

Permalink
Add GitHub Actions workflow for Zig build process
Browse files Browse the repository at this point in the history
  • Loading branch information
playday3008 committed Jan 8, 2025
1 parent 6ce39dc commit 7b1e305
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/zig-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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]
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-primes
uses: actions/cache@v4
with:
path: ./build/${{ matrix.board }}/${{ matrix.optimize }}/toolchain
key: ${{ matrix.board }}-${{ matrix.optimize }}-toolchain

- 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 }}/toolchain"

0 comments on commit 7b1e305

Please sign in to comment.