From cfc01eab6854a8400dfb0e300b5421d5b3b9eeef Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 13 Feb 2026 09:19:02 -0800 Subject: [PATCH] Fixed CI runner failure when executing tests --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 10 ++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09ecb68..2b68240 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Makefile b/Makefile index 748518a..b208654 100644 --- a/Makefile +++ b/Makefile @@ -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 …"