Zig CI #174
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: Zig CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: "0 22 * * 5" # every Friday at 3pm Pacific | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
type: boolean | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
jobs: | |
ci: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install nightly Zig | |
uses: goto-bus-stop/setup-zig@v1 | |
with: | |
version: master | |
- name: Install ziglint | |
uses: AnnikaCodes/[email protected] | |
- name: Lint code | |
run: ziglint . | |
- name: Set up debugging tmate session | |
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
- name: Build executable | |
run: zig build | |
- name: Run tests | |
run: zig build test | |
- name: Executable works! (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: zig-out/bin/ziglint.exe help | |
- name: Executable works! (non-Windows) | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: zig-out/bin/ziglint help |