CI: Update FreeBSD runner to 15.1

With FreeBSD 15.0 going EOL very soon, it is time to update the runner
in the CI to FreeBSD 15.1. This version is supported by Cross-Platform
GitHub Actions since version 1.3.0, and the runner is updated to the
currently newest version 1.6.0, which corresponds to the commit
https://github.com/cross-platform-actions/action/commit/e0b9770014ba65d5e0815f15b74031c3a635f641.

Using the operating system's shell for running commands inside steps is
deprecated. Cross-Platform GitHub Actions provides and recommends the
new custom shell cpa.sh instead, which the runner is now using.

This requires to split the "Build: FreeBSD" step into at least one
separate step for setting up the VM before executing commands in the
following steps. This opens up the opportunity to be more in line with
the Linux runner by installing the build dependencies in its own step,
"Install FreeBSD Dependencies".

Before installing dependencies, the runner now updates the preinstalled
packages in the VM via pkg upgrade -y. This ensures that the whole VM is
cohesively up-to-date.

Last but not least, the TARGET_PRESET environment variable must be set
in the "Build: FreeBSD" step with the --environment-variables option of
cpa.sh, or else it won't be propagated to the build environment.
This commit is contained in:
Stefan Schlosser
2026-10-04 23:35:10 +01:00
committed by Luke Usher
parent 2976a1ab6b
commit a776c509bd
+15 -10
View File
@@ -62,7 +62,7 @@ jobs:
target-cmake-preset: ubuntu-ci-qt
- name: freebsd
os: ubuntu-24.04
shell: bash
shell: cpa.sh {0}
target-cmake-preset: ubuntu-ci-clang
name: ${{ matrix.program }}-${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}
@@ -106,18 +106,23 @@ jobs:
CROSS_COMPILE: ${{ matrix.platform.native-cmake-preset != '' }}
NATIVE_PRESET: ${{ matrix.platform.native-cmake-preset }}
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
- name: "Build: FreeBSD"
- name: "Start FreeBSD VM"
if: matrix.platform.name == 'freebsd'
uses: cross-platform-actions/action@492b0c80085400348c599edace11141a4ee73524
env:
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
uses: cross-platform-actions/action@e0b9770014ba65d5e0815f15b74031c3a635f641
with:
operating_system: freebsd
version: '15.0'
environment_variables: TARGET_PRESET
run: |
sudo pkg install -y cmake pkgconf ccache ninja gtk3 sdl3 librashader
.github/scripts/build_ubuntu.sh
version: '15.1'
- name: "Install FreeBSD Dependencies"
if: matrix.platform.name == 'freebsd'
run: |
sudo pkg upgrade -y
sudo pkg install -y cmake pkgconf ccache ninja gtk3 sdl3 librashader
- name: "Build: FreeBSD"
if: matrix.platform.name == 'freebsd'
env:
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
shell: cpa.sh {0} --environment-variables TARGET_PRESET
run: .github/scripts/build_ubuntu.sh
- name: "Compress Build Artifacts (Windows)"
if: runner.os != 'macOS' && runner.os != 'Linux'
run: |