Skip to content

Commit

Permalink
add test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
seatedro committed Aug 31, 2024
1 parent 9c2a563 commit 99dc2cb
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Zig Build and Test

on:
pull_request:
branches: [ main ]

jobs:
build-and-test:
name: Build and Test on ${{ matrix.os }} (${{ matrix.arch }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
arch: aarch64
- os: macos-latest
arch: x86_64
- os: ubuntu-latest
arch: aarch64
- os: ubuntu-latest
arch: x86_64
- os: windows-latest
arch: x86_64

steps:
- uses: actions/checkout@v2

- name: Set up Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.13.0

- name: Build and Test
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
zig build -Drelease -Dtarget=${{ matrix.arch }}-windows test
elif [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
if [ "${{ matrix.arch }}" = "aarch64" ]; then
zig build -Drelease -Dtarget=${{ matrix.arch }}-linux-gnu test
else
zig build -Drelease -Dtarget=${{ matrix.arch }}-linux test
fi
elif [ "${{ matrix.os }}" = "macos-latest" ]; then
zig build -Drelease -Dtarget=${{ matrix.arch }}-macos test
fi
shell: bash

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
name: test_output-${{ matrix.os }}-${{ matrix.arch }}
path: test_output/

0 comments on commit 99dc2cb

Please sign in to comment.