-
-
Notifications
You must be signed in to change notification settings - Fork 0
188 lines (162 loc) · 4.83 KB
/
Copy pathrun-tests.yml
File metadata and controls
188 lines (162 loc) · 4.83 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: Run Tests
on:
push:
branches: [main, master]
paths-ignore:
- '**/*.md'
- '**/LICENSE*'
- '.github/FUNDING.yml'
pull_request:
branches: [main, master]
paths-ignore:
- '**/*.md'
- '**/LICENSE*'
- '.github/FUNDING.yml'
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
test-linux:
name: Test (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu
runner: ubuntu-latest
setup: sudo apt-get update && sudo apt-get install -y libc-dev
- name: ubuntu-arm64
runner: ubuntu-24.04-arm
setup: sudo apt-get update && sudo apt-get install -y libc-dev
- name: fedora
runner: ubuntu-latest
container: fedora:latest
setup: dnf install -y glibc-devel gcc
- name: arch
runner: ubuntu-latest
container: archlinux/archlinux:latest
setup: pacman -Sy --noconfirm musl gcc
test_cmd: zig build test -Dtarget=native-native-musl --summary all && zig build -Dtarget=native-native-musl
- name: alpine
runner: ubuntu-latest
container: alpine:latest
bootstrap: apk add --no-cache git tar xz musl-dev build-base gcc
setup: ""
- name: amazonlinux
runner: ubuntu-latest
container: amazonlinux:2023
bootstrap: dnf install -y git tar xz
setup: dnf install -y glibc-devel gcc
steps:
- name: Bootstrap
if: matrix.bootstrap != ''
run: ${{ matrix.bootstrap }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Install dependencies
if: matrix.setup != ''
run: ${{ matrix.setup }}
- name: Run tests
run: ${{ matrix.test_cmd || 'zig build test --summary all' }}
- name: Build
if: matrix.test_cmd == ''
run: zig build
test-freebsd:
name: Test (freebsd-x64)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests in FreeBSD VM
uses: vmactions/freebsd-vm@v1
with:
release: "14.2"
prepare: |
export IGNORE_OSVERSION=yes
pkg update
pkg upgrade -y
pkg install -y git cmake ninja llvm18 zstd libxml2 ca_root_nss lang/zig
run: |
git config --global http.sslCAInfo /usr/local/share/certs/ca-root-nss.crt
zig build test --summary all
zig build
test-windows:
name: Test (windows-x64)
runs-on: windows-latest
env:
ZIG_GLOBAL_CACHE: ${{ github.workspace }}/.zig-global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Cache Zig
uses: actions/cache@v4
with:
path: |
.zig-global-cache
zig-cache
key: windows-x64-zig-${{ hashFiles('build.zig.zon', 'build.zig') }}
restore-keys: |
windows-x64-zig-
- name: Run tests
run: zig build test --summary all
- name: Build
run: zig build
test-macos:
name: Test (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- name: macos-x64
runner: macos-latest
- name: macos-arm64
runner: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Run tests
run: zig build test --summary all
- name: Build
run: zig build
cross-compile:
name: Cross-compile (${{ matrix.target }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-linux-gnu
- target: aarch64-linux-gnu
setup: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- target: x86_64-macos-none
- target: aarch64-macos-none
- target: x86_64-windows-gnu
- target: x86_64-freebsd
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Install dependencies
if: matrix.setup != ''
run: ${{ matrix.setup }}
- name: Cross-compile
run: zig build -Dtarget=${{ matrix.target }}