Skip to content

Commit

Permalink
add CI
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Kai <[email protected]>
  • Loading branch information
GrapeBaBa committed Feb 17, 2025
1 parent 59411e4 commit c8aa4a5
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Zig Test and Benchmark

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
ZIG_VERSION: 0.13.0

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: Formatting
run: zig fmt --check --color on .

- name: Installing dependencies
run: |
make deps
- name: Installing spec test
run: |
make deps_test
- name: Unit testing
run: zig build test --summary all

- name: Building
run: zig build -Doptimize=ReleaseFast

0 comments on commit c8aa4a5

Please sign in to comment.