Skip to content

Mute zig-0.16.0-dev regression on windows #6

Mute zig-0.16.0-dev regression on windows

Mute zig-0.16.0-dev regression on windows #6

Workflow file for this run

name: Test library

Check failure on line 1 in .github/workflows/_library.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/_library.yml

Invalid workflow file

(Line: 45, Col: 26): Unrecognized named-value: 'Windows'. Located at position 14 within expression: runner.os == Windows && matrix.zig_version == 'master', (Line: 45, Col: 26): Unexpected value '${{ runner.os == Windows && matrix.zig_version == 'master' }}'
on:
workflow_call:
jobs:
smoke:
name: Build & check
runs-on: blacksmith-2vcpu-ubuntu-2404-arm # arm is half the price
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
- uses: actions/setup-node@v5
- uses: mlugg/setup-zig@v2
- run: pip install git+https://github.com/zig-devel/toolset#latest
- run: zd lint --strict --no-check-sh
- run: zd libcheck --no-run-tests
if: ${{ github.ref_type == 'branch' }}
- run: zd libcheck --no-run-tests --reference=${{github.ref_name}}
if: ${{ github.ref_type == 'tag' }}
test:
runs-on: ${{ matrix.os }}
needs: [smoke]
strategy:
fail-fast: true # save CI if tests fail
matrix:
# It would be nice to run tests on the full matrix (including different OS versions),
# but CI minutes are paid. Blacksmith is significantly cheaper but only provides Linux.
# We can afford x64 and arm64. For the macos and windows, only the main architectures.
os:
- macos-latest # macos arm64
- windows-latest # windows x64
- blacksmith-2vcpu-ubuntu-2404 # linux x64
- blacksmith-2vcpu-ubuntu-2404-arm # linux arm64
# TODO: perhaps we can save CI if check all zig versions within a single job
zig_version: [latest, master]
steps:
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with: { version: "${{ matrix.zig_version }}" }
- name: Unit tests
run: zig build test --summary all -Doptimize=ReleaseSafe
continue-on-error: ${{ runner.os == Windows && matrix.zig_version == 'master' }} # https://github.com/ziglang/translate-c/issues/201
# Converting a git tag into a stub of an immutable release
release:
name: Create GH Release
runs-on: blacksmith-2vcpu-ubuntu-2404-arm # arm is half the price
if: ${{ github.ref_type == 'tag' }}
needs: [test]
permissions:
contents: write # for releases API
steps:
- uses: actions/checkout@v5
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body: |
**Release checks**: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
# Don't change it; have someone review it before releasing.
# We use immutable releases, and there's no way to fix it.
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}