-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (63 loc) · 2.52 KB
/
_library.yml
File metadata and controls
69 lines (63 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Test library
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 }}