-
Notifications
You must be signed in to change notification settings - Fork 30
49 lines (39 loc) · 1.18 KB
/
check.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
name: Zig Test and Benchmark
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
ZIG_VERSION: 0.14.0-dev.1457+7e3180487
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Zig
uses: actions/cache@v3
with:
path: ~/zig
key: ${{ runner.os }}-zig-${{ env.ZIG_VERSION }}
- name: Install Zig
if: steps.cache.outputs.cache-hit != 'true'
run: |
wget https://ziglang.org/builds/zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz
tar -xf zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz
mv zig-linux-x86_64-${{ env.ZIG_VERSION }} ~/zig
- name: Add Zig to PATH
run: echo "${HOME}/zig" >> $GITHUB_PATH
- name: Cache Zig build artifacts
uses: actions/cache@v3
with:
path: |
zig-cache
~/.cache/zig
key: ${{ runner.os }}-zig-build-${{ hashFiles('**/*.zig') }}
restore-keys: |
${{ runner.os }}-zig-build-
- name: Unit testing
run: zig build test --summary all
- name: Run benchmarks
run: zig build bench -Doptimize=ReleaseFast