-
Notifications
You must be signed in to change notification settings - Fork 65
100 lines (85 loc) · 2.63 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
on: [push, pull_request]
name: Test
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
target: [
aarch64-linux-gnu,
aarch64-linux-musl,
x86_64-linux-gnu,
x86_64-linux-musl,
aarch64-macos,
x86_64-macos,
wasm32-wasi,
x86_64-windows-gnu
# Broken but not in any obvious way:
# x86-linux-gnu,
# x86-linux-musl,
# x86-windows,
]
runs-on: ${{ matrix.os }}
needs: [test-x86_64-linux, test-x86_64-windows]
steps:
- name: Checkout code
uses: actions/checkout@v4
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@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Run our checks to catch quick issues
- run: nix flake check
# Run our go tests within the context of the dev shell from the flake. This
# will ensure we have all our dependencies.
- name: test
run: nix develop -c zig build --summary all -Dtarget=${{ matrix.target }}
test-x86_64-linux:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
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@v24
with:
nix_path: nixpkgs=channel:nixos-unstable
# Run our checks to catch quick issues
- run: nix flake check
# Run our go tests within the context of the dev shell from the flake. This
# will ensure we have all our dependencies.
- name: test
run: nix develop -c zig build test --summary all
- name: test wasi
run: nix develop -c zig build test -Dtarget=wasm32-wasi -fwasmtime --summary all
- name: build all benchmarks and examples
run: nix develop -c zig build -Dexample -Dbench --summary all
# Run a full build to ensure that works
- run: nix build
test-x86_64-windows:
strategy:
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Install zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.12.0-dev.2058+04ac028a2
- name: test
run: zig build test --summary all
- name: build all benchmarks and examples
run: zig build -Dexample -Dbench --summary all