Persist Zig build caches in CI
Build and Release / Build executables (pull_request) Failing after 19s

This commit is contained in:
2026-09-14 02:39:34 +00:00
parent 7e60e090f2
commit 1940ec1f35
+19 -4
View File
@@ -1,11 +1,19 @@
name: Build and Release
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: write
@@ -14,6 +22,9 @@ jobs:
build:
name: Build executables
runs-on: ubuntu-latest
env:
ZIG_LOCAL_CACHE_DIR: /ci-cache/zig-chess/0.16.0/linux-amd64/local
ZIG_GLOBAL_CACHE_DIR: /ci-cache/zig-chess/0.16.0/linux-amd64/global
steps:
- name: Checkout
@@ -34,17 +45,21 @@ jobs:
zig version
glslc --version
- name: Prepare persistent Zig caches
run: |
mkdir -p "$ZIG_LOCAL_CACHE_DIR" "$ZIG_GLOBAL_CACHE_DIR"
- name: Build GUI executable
run: |
zig build \
--cache-dir /tmp/zig-chess-cache \
--global-cache-dir /tmp/zig-global-cache
--cache-dir "$ZIG_LOCAL_CACHE_DIR" \
--global-cache-dir "$ZIG_GLOBAL_CACHE_DIR"
- name: Build magic generator executable
run: |
zig build magic-numbers \
--cache-dir /tmp/zig-chess-cache \
--global-cache-dir /tmp/zig-global-cache
--cache-dir "$ZIG_LOCAL_CACHE_DIR" \
--global-cache-dir "$ZIG_GLOBAL_CACHE_DIR"
- name: Package executables
run: |