Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 19 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,58 @@
name: CI

on:
create:
push:
branches: master
paths:
- '**.zig'
branches: [master]
pull_request:
schedule:
- cron: "0 13 * * *"
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
strategy:
fail-fast: false
matrix:
# 0.16 fmt cannot parse @fromBackingInt/@backingInt (0.17-renamed builtins) and
# 0.17 fmt rewrites @enumFromInt/@intFromEnum to those new names, so no single
# source can satisfy both formatters; lint with 0.16.0 only.
zig_version: ["0.16.0"]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- run: zig fmt --check *.zig
version: ${{ matrix.zig_version }}
- run: zig fmt --check *.zig c/*.zig build.zig

test-in-memory:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest, macos-latest]
zig_version: ["0.16.0", "master"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
version: ${{ matrix.zig_version }}
use-cache: true
cache-size-limit: 2048

- name: Install qemu
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
sudo apt-get update -y && sudo apt-get install -y qemu-user-binfmt

- name: Restore cache
uses: actions/cache@v4
with:
path: |
zig-cache
~/.cache/zig
key: ${{ runner.os }}-${{ matrix.os }}-zig-${{ github.sha }}
restore-keys: ${{ runner.os }}-${{ matrix.os }}-zig-

- name: Run Tests in memory
if: ${{ matrix.os == 'ubuntu-24.04' }}
run: |
mkdir -p $ZIG_GLOBAL_CACHE_DIR/tmp
mkdir -p "$ZIG_GLOBAL_CACHE_DIR/tmp"
zig build test -Dci=true -Din_memory=true --summary all -fqemu -fwine
- name: Run Tests in memory
if: ${{ matrix.os != 'ubuntu-24.04' }}
shell: bash
run: |
mkdir -p $ZIG_GLOBAL_CACHE_DIR/tmp
mkdir -p "$ZIG_GLOBAL_CACHE_DIR/tmp"
zig build test -Dci=true -Din_memory=true --summary all
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ core.*
/fuzz/outputs
.DS_Store
/zig-pkg
# Host binary built by the build script (the preprocessor)
/zig-sqlite-preprocess
Loading