Fixed CI runner failure when executing tests

This commit is contained in:
Mick Grove 2026-02-13 09:19:02 -08:00
commit cfc01eab68
2 changed files with 40 additions and 4 deletions

View file

@ -13,6 +13,40 @@ env:
RUST_TOOLCHAIN: "1.92"
jobs:
linux-x64:
name: Linux x64
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# Free up disk space on Ubuntu runners
- name: Free Disk Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
df -h
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
profile: minimal
override: true
- uses: swatinem/rust-cache@v2
with:
shared-key: kingfisher-${{ runner.os }}-${{ runner.arch }}
cache-on-failure: true
- name: Build (Makefile linux-x64)
run: make ubuntu-x64
- name: Run tests
run: make tests
env:
CARGO_BUILD_JOBS: 1
linux-arm64:
name: Linux arm64
runs-on: ubuntu-24.04-arm

View file

@ -2,6 +2,7 @@ SHELL := /usr/bin/env bash
.SHELLFLAGS := -eu -o pipefail -c
PROJECT_NAME := kingfisher
ZIG_VERSION ?= 0.15.1
# Determine OS and whether to use gtar on darwin
OS := $(shell uname)
@ -74,7 +75,7 @@ create-dockerignore:
.PHONY: setup-zig
setup-zig:
@command -v zig >/dev/null 2>&1 || { \
echo "⬇️ Installing Zig 0.14.0 …"; \
echo "⬇️ Installing Zig $(ZIG_VERSION)"; \
if $(SUDO_CMD) apt-get update -qq && \
$(SUDO_CMD) apt-get install -y --no-install-recommends zig 2>/dev/null ; then \
echo "✓ Zig installed via apt"; \
@ -82,11 +83,11 @@ setup-zig:
echo "⚠️ Package 'zig' not in apt repos falling back to manual install"; \
arch=$$(uname -m); \
case "$$arch" in \
x86_64) pkg=zig-linux-x86_64-0.14.0 ;; \
aarch64|arm64) pkg=zig-linux-aarch64-0.14.0 ;; \
x86_64) pkg=zig-linux-x86_64-$(ZIG_VERSION) ;; \
aarch64|arm64) pkg=zig-linux-aarch64-$(ZIG_VERSION) ;; \
*) echo "Unsupported architecture: $$arch"; exit 1 ;; \
esac; \
curl -L -o /tmp/zig.tar.xz https://ziglang.org/download/0.14.0/$${pkg}.tar.xz; \
curl -L -o /tmp/zig.tar.xz https://ziglang.org/download/$(ZIG_VERSION)/$${pkg}.tar.xz; \
tar -C /tmp -xf /tmp/zig.tar.xz; \
$(SUDO_CMD) mv /tmp/$${pkg} /opt/zig; \
$(SUDO_CMD) ln -sf /opt/zig/zig /usr/local/bin/zig; \
@ -128,6 +129,7 @@ ubuntu-x64: setup-zig # ensures Zig & cargo-zigbuild exist
@. $$HOME/.cargo/env && \
rustup target add x86_64-unknown-linux-musl && \
export PKG_CONFIG_ALLOW_CROSS=1 && \
export CMAKE_ARGS_x86_64_unknown_linux_musl="-DHAVE_UNISTD_H=1 -DHAVE_POSIX_MEMALIGN=1" && \
cargo zigbuild --release --target x86_64-unknown-linux-musl
@echo "🗜️ Packaging archive …"