CI #2088
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
create: | |
push: | |
branches: master | |
paths: | |
- '**.zig' | |
pull_request: | |
schedule: | |
- cron: "0 13 * * *" | |
workflow_dispatch: | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: master | |
- run: zig fmt --check *.zig | |
test-in-memory: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: master | |
- name: Install qemu | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
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-latest' }} | |
run: zig build test -Dci=true -Din_memory=true --summary all -fqemu -fwine | |
- name: Run Tests in memory | |
if: ${{ matrix.os != 'ubuntu-latest' }} | |
run: zig build test -Dci=true -Din_memory=true --summary all | |
test-loadable-extension: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup zig | |
uses: goto-bus-stop/setup-zig@v2 | |
with: | |
version: master | |
- name: Build the example zigcrypto loadable extension | |
run: zig build zigcrypto | |
- name: Test the zigcrypto loadable extension | |
run: ./zig-out/bin/zigcrypto-test |