-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (68 loc) · 1.98 KB
/
ci.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
name: CI
on:
push:
branches: [master]
paths:
- build.zig
- src/*
- .github/workflows/*
pull_request:
paths:
- build.zig
- src/*
- .github/workflows/*
concurrency:
cancel-in-progress: true
group: ${{github.workflow}}-${{github.ref_name}}
jobs:
test:
runs-on: ${{matrix.os}}
name: Test target ${{matrix.target}}
strategy:
fail-fast: false
matrix:
target:
- x86_64-linux-gnu
- x86_64-linux-musl
- aarch64-linux-gnu
- x86_64-windows-gnu
- x86_64-windows-msvc
- aarch64-macos-none
include:
- os: ubuntu-latest
target: x86_64-linux-gnu
- os: ubuntu-latest
target: x86_64-linux-musl
- os: ubuntu-latest
target: aarch64-linux-gnu
flags: -fqemu -Ddynamic-linker=/usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1
- os: windows-latest
target: x86_64-windows-gnu
- os: windows-latest
target: x86_64-windows-msvc
- os: macos-latest
target: aarch64-macos-none
- os: macos-latest
target: x86_64-macos-none
flags: -frosetta
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/setup-zig@v1
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
if: matrix.target == 'x86_64-windows-msvc'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: matrix.target == 'aarch64-linux-gnu'
with:
platforms: arm64
- name: Install packages
if: matrix.target == 'aarch64-linux-gnu'
run: |-
sudo apt-get update
sudo apt-get install -y libc6-dev-arm64-cross
printf 'LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib\n' >> "$GITHUB_ENV"
- name: Run unit tests
run: zig build test -Dtarget=${{matrix.target}} ${{matrix.flags}} --verbose