-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (82 loc) · 2.33 KB
/
test.yml
File metadata and controls
96 lines (82 loc) · 2.33 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
name: Tests
on:
push:
branches: [master, develop]
paths:
- "zig-toolchain.cmake"
- "build.zig"
- "test/**"
- ".github/workflows/test.yml"
pull_request:
branches: [master]
paths:
- "zig-toolchain.cmake"
- "build.zig"
- "test/**"
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Enable debug mode"
required: false
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.os }} / Zig ${{ matrix.zig_version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
continue-on-error: ${{ matrix.zig_version == 'master' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
zig_version: ["0.14.1", "0.15.2"]
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Zig
uses: mlugg/setup-zig@v2
with:
version: ${{ matrix.zig_version }}
- name: Get Zig version
id: zig-ver
run: echo "version=$(zig version)" >> $GITHUB_OUTPUT
- name: Cache Zig dependencies
uses: actions/cache@v5
with:
path: |
~/.cache/zig
~/AppData/Local/zig
~/Library/Caches/zig
key: ${{ runner.os }}-zig-deps-${{ steps.zig-ver.outputs.version }}
restore-keys: |
${{ runner.os }}-zig-deps-
- name: Set up CMake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: "3.25"
- name: Set up Build Tools (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build ccache
- name: Set up Build Tools (Windows)
if: runner.os == 'Windows'
run: |
choco install -y ninja ccache
- name: Set up Build Tools (macOS)
if: runner.os == 'macOS'
run: |
brew install ninja ccache
- name: System information
run: |
zig version
cmake --version
ninja --version
ccache --version
- name: Run tests
run: |
zig build test