mirror of
https://github.com/mikkelam/fast-cli.git
synced 2025-12-16 20:04:05 +00:00
45 lines
1 KiB
YAML
45 lines
1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: mlugg/setup-zig@v2
|
|
with:
|
|
version: 0.15.2
|
|
- run: zig build test
|
|
- run: zig fmt --check src/
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
strategy:
|
|
matrix:
|
|
target: [x86_64-linux, x86_64-macos, aarch64-linux]
|
|
optimize: [Debug, ReleaseSafe]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: mlugg/setup-zig@v2
|
|
with:
|
|
version: 0.15.2
|
|
- name: Build ${{ matrix.target }} (${{ matrix.optimize }})
|
|
run: |
|
|
zig build --release=${{ matrix.optimize == 'ReleaseSafe' && 'safe' || 'off' }} -Dtarget=${{ matrix.target }}
|
|
|
|
- name: Test help command
|
|
if: matrix.target == 'x86_64-linux'
|
|
run: ./zig-out/bin/fast-cli --help
|
|
|
|
- name: Check binary type
|
|
if: matrix.target == 'x86_64-linux'
|
|
run: file zig-out/bin/fast-cli
|