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.