From 1f38adf7473d26938ea59d97d7f3acc5de427818 Mon Sep 17 00:00:00 2001 From: mcaney006 <254775535+mcaney006@users.noreply.github.com> Date: Wed, 18 Nov 2026 00:23:02 -0500 Subject: [PATCH] Run zig build test in GitHub Actions on Linux and macOS Runs on pull requests and pushes to main with Zig 0.17.1. Actions are pinned to commit SHAs, the token is read-only, and checkout does not keep credentials. The Docker labs still run locally. --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ README.md | 5 +++++ 2 files changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d476f8e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: zig build test (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + timeout-minutes: 20 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1 + with: + version: 0.17.1 + - run: zig build test --summary all diff --git a/README.md b/README.md index 7093ac6..1587f05 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,11 @@ ARCH=aarch64 sh tests/lab/syn_lab.sh # two containers on Docker bridges ARCH=aarch64 sh tests/bench/capture_bench.sh ``` +GitHub Actions runs `zig build test` on Linux and macOS for every pull +request and every push to `main` (`.github/workflows/ci.yml`). The labs +and benchmarks need Docker and root inside containers, so they run +locally, not in CI. + The labs need Docker and run only inside throwaway containers and networks. They never touch the host's routing, ARP, DNS or firewall.