2022-10-15 15:00:41 -07:00

69 lines
1.6 KiB
YAML

on: [push, pull_request]
name: Test
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
target: [
aarch64-macos,
x86_64-macos,
aarch64-linux-gnu,
x86_64-linux-gnu,
# No windows support currently.
# i386-windows,
# x86_64-windows-gnu,
]
runs-on: ${{ matrix.os }}
needs: test
env:
# Needed for macos SDK
AGREE: "true"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
# Cross-compile the binary. We always use static building for this
# because its the only way to access the headers.
- name: Test Build
run: nix develop -c zig build -Dstatic=true -Dtarget=${{ matrix.target }}
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: test
run: nix develop -c zig build test -fstage1
- name: test stage2
run: nix develop -c zig build test
- name: Test Dynamic Build
run: nix develop -c zig build -Dstatic=false