Skip to content

Run all tests

Run all tests #26

Workflow file for this run

name: Run all tests
on:
push:
branches:
- 'master'
tags:
- '**'
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
schedule:
- cron: '30 4 * * SAT'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-24.05
- uses: workflow/nix-shell-action@v3.3.2
with:
packages: zig
script: |
zig build test
release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
needs: [ test ]
strategy:
matrix:
include:
- target: aarch64-macos-none
name: ghh_darwin_aarch64.zip
- target: x86_64-macos-none
name: ghh_darwin_x86_64.zip
- target: x86_64-linux-musl
name: ghh_linux_x86_64.zip
- target: aarch64-linux-musl
name: ghh_linux_aarch64.zip
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-24.05
- uses: workflow/nix-shell-action@v3.3.2
env:
target: ${{ matrix.target }}
with:
packages: zig
script: |
zig build -Doptimize=ReleaseSafe -Dtarget=${{matrix.target}} --summary all && (cd zig-out/bin && zip ${{matrix.name}} ghh)
- uses: actions/upload-artifact@v4
with:
name: ${{matrix.name}}
path: zig-out/bin/${{matrix.name}}
- uses: softprops/action-gh-release@v2
with:
files: |
zig-out/bin/${{matrix.name}}