Repository navigation
58 lines (49 loc) · 1.72 KB
/
Copy pathci.yaml
File metadata and controls
58 lines (49 loc) · 1.72 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
zig-version: [0.16.0, 0.17.0, master]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.zig-version == 'master' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: ${{ matrix.zig-version }}
- name: Workaround Zig 0.16.0 ZIP unpack failure
# https://codeberg.org/ziglang/zig/issues/31964
shell: bash
run: mkdir -p "${ZIG_GLOBAL_CACHE_DIR}/tmp"
- name: Check Formatting
if: runner.os != 'Windows' # zig fmt failing on Windows CI, unclear why
run: zig fmt --ast-check --check .
- name: Build for Windows
# See issue #40
if: matrix.zig-version != 'master'
run: zig build example -Dtarget=x86_64-windows-gnu --summary all
- name: Build for Linux
run: zig build example -Dtarget=x86_64-linux-gnu --summary all
- name: Build for macOS
if: runner.os == 'macOS'
# We don't support cross compiling for macOS, so don't set a target just build
# the native target
run: zig build example --summary all
- name: Build for iOS
if: runner.os == 'macOS'
# The iOS SDK is not bundled with Zig, so point the build at Xcode's iPhoneOS SDK.
run: |
SDK="$(xcrun --sdk iphoneos --show-sdk-path)"
zig build -Dtarget=aarch64-ios -Dinclude_path="$SDK/usr/include" -Dframework_path="$SDK/System/Library/Frameworks" --summary all