Skip to content

Commit a3e6f63

Browse files
CI: integrate all OSes into ci.yml
1 parent eca12e1 commit a3e6f63

File tree

5 files changed

+188
-357
lines changed

5 files changed

+188
-357
lines changed

.github/workflows/ci.yml

Lines changed: 188 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
runs-on: ubuntu-24.04
5656
timeout-minutes: 25
57-
needs: [security]
57+
needs: [lint, security]
5858

5959
steps:
6060
- uses: actions/checkout@v4
@@ -120,7 +120,7 @@ jobs:
120120
echo "Using LD_PRELOAD=$LD_PRELOAD"
121121
pytest -v --benchmark-skip -k "not remote"
122122
123-
posix_tests:
123+
native_tests:
124124

125125
needs: [lint, security]
126126
permissions:
@@ -328,12 +328,197 @@ jobs:
328328
path: artifacts/*
329329
if-no-files-found: error
330330

331+
vm_tests:
332+
permissions:
333+
contents: read
334+
id-token: write
335+
attestations: write
336+
runs-on: ubuntu-24.04
337+
timeout-minutes: 90
338+
needs: [lint, security]
339+
continue-on-error: true
340+
341+
strategy:
342+
fail-fast: false
343+
matrix:
344+
include:
345+
- os: freebsd
346+
version: '14.3'
347+
display_name: FreeBSD
348+
# Controls binary build and provenance attestation on tags
349+
do_binaries: true
350+
artifact_prefix: borg-freebsd-14-x86_64-gh
351+
352+
- os: netbsd
353+
version: '10.1'
354+
display_name: NetBSD
355+
do_binaries: false
356+
357+
- os: openbsd
358+
version: '7.7'
359+
display_name: OpenBSD
360+
do_binaries: false
361+
362+
- os: haiku
363+
version: 'r1beta5'
364+
display_name: Haiku
365+
do_binaries: false
366+
367+
steps:
368+
- name: Check out repository
369+
uses: actions/checkout@v4
370+
with:
371+
fetch-depth: 0
372+
fetch-tags: true
373+
374+
- name: Test on ${{ matrix.display_name }}
375+
id: cross_os
376+
uses: cross-platform-actions/[email protected]
377+
env:
378+
DO_BINARIES: ${{ matrix.do_binaries }}
379+
with:
380+
operating_system: ${{ matrix.os }}
381+
version: ${{ matrix.version }}
382+
shell: bash
383+
run: |
384+
set -euxo pipefail
385+
386+
case "${{ matrix.os }}" in
387+
freebsd)
388+
export IGNORE_OSVERSION=yes
389+
sudo -E pkg update -f
390+
sudo -E pkg install -y xxhash liblz4 zstd pkgconf
391+
# Install one of the FUSE libraries; fail if neither is available
392+
sudo -E pkg install -y fusefs-libs || sudo -E pkg install -y fusefs-libs3
393+
sudo -E pkg install -y rust
394+
sudo -E pkg install -y git
395+
sudo -E pkg install -y python310 py310-sqlite3
396+
sudo -E pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
397+
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
398+
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python
399+
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip3
400+
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip
401+
402+
python -m venv .venv
403+
. .venv/bin/activate
404+
python -V
405+
pip -V
406+
python -m pip install --upgrade pip wheel
407+
pip install -r requirements.d/development.txt
408+
pip install -e .
409+
pytest -v -n auto --benchmark-skip
410+
411+
if [[ "${DO_BINARIES}" == "true" && "${GITHUB_REF:-}" == refs/tags/* ]]; then
412+
python -m pip install 'pyinstaller==6.14.2'
413+
mkdir -p dist/binary
414+
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
415+
pushd dist/binary
416+
echo "single-file binary"
417+
chmod +x borg.exe
418+
./borg.exe -V
419+
echo "single-directory binary"
420+
chmod +x borg-dir/borg.exe
421+
./borg-dir/borg.exe -V
422+
tar czf borg.tgz borg-dir
423+
popd
424+
mkdir -p artifacts
425+
if [ -f dist/binary/borg.exe ]; then
426+
cp -v dist/binary/borg.exe artifacts/${{ matrix.artifact_prefix }}
427+
fi
428+
if [ -f dist/binary/borg.tgz ]; then
429+
cp -v dist/binary/borg.tgz artifacts/${{ matrix.artifact_prefix }}.tgz
430+
fi
431+
fi
432+
;;
433+
434+
netbsd)
435+
arch="$(uname -m)"
436+
sudo -E mkdir -p /usr/pkg/etc/pkgin
437+
echo "http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/${arch}/10.1/All" | sudo tee /usr/pkg/etc/pkgin/repositories.conf > /dev/null
438+
sudo -E pkgin update || true
439+
sudo -E pkgin -y upgrade || true
440+
sudo -E pkgin -y install zstd lz4 xxhash git || true
441+
sudo -E pkgin -y install rust || true
442+
sudo -E pkgin -y install pkg-config || true
443+
sudo -E pkgin -y install py311-pip py311-virtualenv || true
444+
sudo -E ln -sf /usr/pkg/bin/python3.11 /usr/pkg/bin/python3 || true
445+
sudo -E ln -sf /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip3 || true
446+
sudo -E ln -sf /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv3 || true
447+
448+
python3 -m virtualenv .venv
449+
. .venv/bin/activate
450+
python -m pip install --upgrade pip
451+
pip install -r requirements.d/development.txt
452+
pip install -e .
453+
pytest -v -n auto --benchmark-skip
454+
;;
455+
456+
openbsd)
457+
# echo "https://ftp.eu.openbsd.org/pub/OpenBSD" | sudo tee /etc/installurl > /dev/null || true
458+
sudo -E pkg_add xxhash || true
459+
sudo -E pkg_add lz4 || true
460+
sudo -E pkg_add zstd || true
461+
sudo -E pkg_add git || true
462+
sudo -E pkg_add rust || true
463+
sudo -E pkg_add openssl%3.4 || true
464+
sudo -E pkg_add py3-pip || true
465+
sudo -E pkg_add py3-virtualenv || true
466+
467+
export BORG_OPENSSL_NAME=eopenssl34
468+
python3 -m virtualenv .venv
469+
. .venv/bin/activate
470+
python -m pip install --upgrade pip
471+
pip install -r requirements.d/development.txt
472+
pip install -e .
473+
pytest -v -n auto --benchmark-skip
474+
;;
475+
476+
haiku)
477+
pkgman refresh || true
478+
pkgman install -y git pkgconfig zstd lz4 xxhash || true
479+
pkgman install -y openssl3 || true
480+
pkgman install -y rust_bin || true
481+
pkgman install -y python3.10 || true
482+
pkgman install -y cffi || true
483+
python3 -V || true
484+
pkgman install -y lz4_devel zstd_devel xxhash_devel openssl3_devel libffi_devel || true
485+
export PKG_CONFIG_PATH="/system/develop/lib/pkgconfig:/system/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
486+
export BORG_LIBLZ4_PREFIX=/system/develop
487+
export BORG_LIBZSTD_PREFIX=/system/develop
488+
export BORG_LIBXXHASH_PREFIX=/system/develop
489+
export BORG_OPENSSL_PREFIX=/system/develop
490+
491+
python3 -m ensurepip --upgrade || true
492+
python3 -m pip install --upgrade pip wheel
493+
python3 -m venv .venv
494+
. .venv/bin/activate
495+
python -V
496+
pip install -r requirements.d/development.txt
497+
pip install -e .
498+
pytest -v --benchmark-skip -k "not remote and not socket"
499+
;;
500+
esac
501+
502+
- name: Upload artifacts
503+
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
504+
uses: actions/upload-artifact@v4
505+
with:
506+
name: ${{ matrix.os }}-${{ matrix.version }}-dist
507+
path: artifacts/*
508+
if-no-files-found: ignore
509+
510+
- name: Attest provenance
511+
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
512+
uses: actions/attest-build-provenance@v3
513+
with:
514+
subject-path: 'artifacts/*'
515+
331516
windows_tests:
332517

333518
if: false # can be used to temporarily disable the build
334519
runs-on: windows-latest
335520
timeout-minutes: 120
336-
needs: posix_tests
521+
needs: native_tests
337522

338523
env:
339524
PY_COLORS: 1

.github/workflows/freebsd.yml

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)