-
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (114 loc) · 3.26 KB
/
Copy pathci.yml
File metadata and controls
131 lines (114 loc) · 3.26 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Run Zig tests
run: zig build test --summary all
- name: Build library (Debug)
run: zig build -Doptimize=Debug
- name: Build library (ReleaseFast)
run: zig build -Doptimize=ReleaseFast
- name: Run benchmarks
run: zig build bench
- name: Zig format check
run: zig fmt --check src/ examples/ bench/
examples-run:
name: Run Examples (${{ matrix.target }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-linux
- os: ubuntu-latest
target: x86-linux
- os: ubuntu-latest
target: aarch64-linux
- os: macos-latest
target: x86_64-macos
- os: macos-latest
target: aarch64-macos
- os: windows-latest
target: x86_64-windows
- os: windows-latest
target: x86-windows
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Install QEMU and Multilib (Linux)
if: runner.os == 'Linux' && (matrix.target == 'aarch64-linux' || matrix.target == 'x86-linux')
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static gcc-multilib
if [ "${{ matrix.target }}" = "aarch64-linux" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu
fi
- name: Run Zig tests on ${{ matrix.target }}
run: zig build test -Dtarget=${{ matrix.target }} --summary all
- name: Run all examples on ${{ matrix.target }}
run: |
echo "Running examples for ${{ matrix.target }}"
zig build run-all-examples -Dtarget=${{ matrix.target }}
examples-build-only:
name: Build (${{ matrix.target }})
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-linux
- x86-linux
- aarch64-linux
- x86_64-macos
- aarch64-macos
- x86_64-windows
- x86-windows
- x86_64-freestanding
- aarch64-freestanding
- riscv64-freestanding
- riscv64-linux
- riscv32-linux
- powerpc64le-linux
- mips64-linux
- s390x-linux
- arm-freestanding
- arm-linux-gnueabihf
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: Build for ${{ matrix.target }} (build-only)
run: zig build -Dtarget=${{ matrix.target }} -Doptimize=Debug