From 06e5386d935ec08d6bcc37ff0ccacef6a1fcfd15 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 16:22:59 -0400 Subject: [PATCH] Move FreeBSD deps install to common CI script Making the OS filter in test driver consistent as per https://github.com/gbdev/rgbds/pull/1899#discussion_r2942998932 --- .github/scripts/install_deps.sh | 8 ++++++-- .github/workflows/testing.yml | 9 ++------- test/run-tests.sh | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh index 708ac6cd..a6b3ab4e 100755 --- a/.github/scripts/install_deps.sh +++ b/.github/scripts/install_deps.sh @@ -1,5 +1,6 @@ -#!/usr/bin/env bash -set -euo pipefail +#!/bin/sh +# This script requires `sh` instead of `bash` because the latter is not always installed on FreeBSD. +set -eu case "${1%-*}" in ubuntu) @@ -13,6 +14,9 @@ case "${1%-*}" in export PATH="/opt/homebrew/opt/bison/bin:$PATH" printf 'PATH=%s\n' "$PATH" >>"$GITHUB_ENV" # Make it available to later CI steps too ;; + freebsd) + pkg install -y bash bison cmake git png + ;; *) echo "WARNING: Cannot install deps for OS '$1'" ;; diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bdb16545..ec197a56 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -376,14 +376,9 @@ jobs: release: "14.3" usesh: true prepare: | - pkg install -y \ - bash \ - bison \ - cmake \ - git \ - png + .github/scripts/install_deps.sh freebsd run: | # FreeBSD `c++` compiler does not support `make develop` sanitizers ASan or UBSan - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DTESTS_OS_NAME=bsd + cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DTESTS_OS_NAME=freebsd cmake --build build -j4 --verbose cmake --install build --verbose cmake --build build --target test diff --git a/test/run-tests.sh b/test/run-tests.sh index c648faf4..d473b431 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -138,6 +138,6 @@ test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 11390 # gb-starter kit fails with any `make` on Windows: https://codeberg.org/ISSOtm/gb-starter-kit/issues/1 # gb-starter-kit fails with macOS/BSD `make`: https://codeberg.org/ISSOtm/gb-starter-kit/issues/29 case "${osname%%-*}" in - windows | macos | bsd) ;; + windows | macos | *bsd) ;; *) test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe;; esac