Skip to content

build-and-test

build-and-test #879

name: build-and-test
on:
push:
pull_request:
schedule:
- cron: 0 4 * * *
jobs:
build-and-test:
strategy:
matrix:
zig-version: ['master']
runs-on: ubuntu-latest
name: Test / Zig ${{ matrix.zig-version }}
steps:
- uses: actions/checkout@v4
- uses: mlugg/setup-zig@v2
with:
version: ${{ matrix.zig-version }}
- run: zig fmt --check ./*.zig src/*.zig
- run: zig build
- run: zig build test
- run: zig build test --release=fast
- run: zig build test --release=safe
- run: zig build docs
- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule'
uses: actions/upload-pages-artifact@v3
with:
path: ./zig-out/docs/
deploy-pages:
runs-on: ubuntu-latest
needs: build-and-test
if: github.ref == 'refs/heads/main' && github.event_name != 'schedule'
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4