File tree Expand file tree Collapse file tree 1 file changed +71
-0
lines changed
Expand file tree Collapse file tree 1 file changed +71
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Zig Test and Benchmark
2+
3+ on :
4+ push :
5+ branches : [main]
6+ pull_request :
7+ branches : [main]
8+
9+ env :
10+ ZIG_VERSION : 0.14.0-dev.2079+ba2d00663
11+
12+ jobs :
13+ build :
14+ strategy :
15+ matrix :
16+ os : [ubuntu-latest, macos-latest, windows-latest]
17+ runs-on : ${{ matrix.os }}
18+
19+ steps :
20+ - uses : actions/checkout@v3
21+
22+ - name : Cache Zig
23+ uses : actions/cache@v3
24+ with :
25+ path : ~/zig
26+ key : ${{ runner.os }}-zig-${{ env.ZIG_VERSION }}
27+
28+ - name : Install Zig
29+ if : steps.cache.outputs.cache-hit != 'true'
30+ run : |
31+ case ${{ runner.os }} in
32+ Linux)
33+ wget https://ziglang.org/builds/zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz
34+ tar -xf zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz
35+ mv zig-linux-x86_64-${{ env.ZIG_VERSION }} ~/zig
36+ ;;
37+ macOS)
38+ wget https://ziglang.org/builds/zig-macos-x86_64-${{ env.ZIG_VERSION }}.tar.xz
39+ tar -xf zig-macos-x86_64-${{ env.ZIG_VERSION }}.tar.xz
40+ mv zig-macos-x86_64-${{ env.ZIG_VERSION }} ~/zig
41+ ;;
42+ Windows)
43+ curl -L https://ziglang.org/builds/zig-windows-x86_64-${{ env.ZIG_VERSION }}.zip -o zig.zip
44+ 7z x zig.zip
45+ mv zig-windows-x86_64-${{ env.ZIG_VERSION }} ~/zig
46+ ;;
47+ esac
48+ shell : bash
49+
50+ - name : Add Zig to PATH
51+ run : echo "${HOME}/zig" >> $GITHUB_PATH
52+ shell : bash
53+
54+ - name : Cache Zig build artifacts
55+ uses : actions/cache@v3
56+ with :
57+ path : |
58+ zig-cache
59+ ~/.cache/zig
60+ key : ${{ runner.os }}-zig-build-${{ hashFiles('**/*.zig') }}
61+ restore-keys : |
62+ ${{ runner.os }}-zig-build-
63+
64+ - name : Formatting
65+ run : zig fmt --check --color on .
66+
67+ - name : Unit testing
68+ run : zig build test --summary all
69+
70+ - name : Building
71+ run : zig build -Doptimize=ReleaseFast
You can’t perform that action at this time.
0 commit comments