Skip to content

Commit 4a97c12

Browse files
CI: backport vm_tests (FreeBSD/NetBSD/OpenBSD/Haiku) from master branch
1 parent b386060 commit 4a97c12

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

.github/workflows/ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,105 @@ jobs:
254254
name: ${{ matrix.binary }}
255255
path: artifacts/*
256256
if-no-files-found: error
257+
258+
vm_tests:
259+
260+
# Cross-OS tests running inside VMs, aligned with master branch structure.
261+
# Uses cross-platform-actions/action to run on FreeBSD, NetBSD, OpenBSD, Haiku.
262+
permissions:
263+
contents: read
264+
id-token: write
265+
attestations: write
266+
runs-on: ubuntu-24.04
267+
timeout-minutes: 90
268+
needs: [lint]
269+
continue-on-error: true
270+
strategy:
271+
fail-fast: false
272+
matrix:
273+
include:
274+
- os: freebsd
275+
version: '14.3'
276+
display_name: FreeBSD
277+
do_binaries: false
278+
- os: netbsd
279+
version: '10.1'
280+
display_name: NetBSD
281+
do_binaries: false
282+
- os: openbsd
283+
version: '7.7'
284+
display_name: OpenBSD
285+
do_binaries: false
286+
- os: haiku
287+
version: 'r1beta5'
288+
display_name: Haiku
289+
do_binaries: false
290+
291+
steps:
292+
- name: Check out repository
293+
uses: actions/checkout@v4
294+
with:
295+
fetch-depth: 0
296+
fetch-tags: true
297+
298+
- name: Test on ${{ matrix.display_name }}
299+
id: cross_os
300+
uses: cross-platform-actions/[email protected]
301+
env:
302+
DO_BINARIES: ${{ matrix.do_binaries }}
303+
with:
304+
operating_system: ${{ matrix.os }}
305+
version: ${{ matrix.version }}
306+
shell: bash
307+
run: |
308+
set -euxo pipefail
309+
case "${{ matrix.os }}" in
310+
freebsd)
311+
export IGNORE_OSVERSION=yes
312+
sudo -E pkg update -f
313+
sudo -E pkg install -y xxhash liblz4 zstd pkgconf git openssl
314+
# FUSE libs (if available); ignore if missing
315+
sudo -E pkg install -y fusefs-libs || sudo -E pkg install -y fusefs-libs3 || true
316+
# Python
317+
sudo -E pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
318+
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3 || true
319+
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip3 || true
320+
;;
321+
netbsd)
322+
sudo /usr/sbin/pkgin -y update || true
323+
sudo /usr/sbin/pkgin -y install python311 py311-pip py311-setuptools py311-wheel py311-virtualenv git openssl lz4 zstd xxhash || true
324+
python3.11 -m ensurepip || true
325+
;;
326+
openbsd)
327+
sudo pkg_add -I git || true
328+
# Python 3.11 and deps
329+
sudo pkg_add -I python%3.11 || true
330+
command -v python3 || ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
331+
;;
332+
haiku)
333+
pkgman refresh
334+
pkgman update -y || true
335+
pkgman install -y python3 cmd:python3 pip setuptools_scm git gcc openssl_devel liblz4_devel zstd_devel xxhash || true
336+
;;
337+
esac
338+
# Common: virtualenv, install, run tests
339+
python3 -m venv .venv
340+
. .venv/bin/activate
341+
python -m pip install --upgrade pip
342+
# On some platforms wheels may be missing; retry building from sdist where possible
343+
pip install -r requirements.d/development.txt || true
344+
pip install -e .
345+
case "${{ matrix.os }}" in
346+
haiku)
347+
# Haiku lacks complete POSIX modes/ACLs and FUSE; skip those and remote tests
348+
BORG_TESTS_IGNORE_MODES=1 pytest -v --benchmark-skip -k "not fuse and not remote"
349+
;;
350+
openbsd|netbsd)
351+
# BSD VMs usually cannot run our FUSE test setup; skip fuse and remote
352+
pytest -v --benchmark-skip -k "not fuse and not remote"
353+
;;
354+
freebsd)
355+
# Be conservative like on other BSDs for CI stability
356+
pytest -v --benchmark-skip -k "not fuse and not remote"
357+
;;
358+
esac

0 commit comments

Comments
 (0)