Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 188 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

runs-on: ubuntu-24.04
timeout-minutes: 25
needs: [security]
needs: [lint, security]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
echo "Using LD_PRELOAD=$LD_PRELOAD"
pytest -v --benchmark-skip -k "not remote"

posix_tests:
native_tests:

needs: [lint, security]
permissions:
Expand Down Expand Up @@ -328,12 +328,197 @@ jobs:
path: artifacts/*
if-no-files-found: error

vm_tests:
permissions:
contents: read
id-token: write
attestations: write
runs-on: ubuntu-24.04
timeout-minutes: 90
needs: [lint, security]
continue-on-error: true

strategy:
fail-fast: false
matrix:
include:
- os: freebsd
version: '14.3'
display_name: FreeBSD
# Controls binary build and provenance attestation on tags
do_binaries: true
artifact_prefix: borg-freebsd-14-x86_64-gh

- os: netbsd
version: '10.1'
display_name: NetBSD
do_binaries: false

- os: openbsd
version: '7.7'
display_name: OpenBSD
do_binaries: false

- os: haiku
version: 'r1beta5'
display_name: Haiku
do_binaries: false

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Test on ${{ matrix.display_name }}
id: cross_os
uses: cross-platform-actions/[email protected]
env:
DO_BINARIES: ${{ matrix.do_binaries }}
with:
operating_system: ${{ matrix.os }}
version: ${{ matrix.version }}
shell: bash
run: |
set -euxo pipefail

case "${{ matrix.os }}" in
freebsd)
export IGNORE_OSVERSION=yes
sudo -E pkg update -f
sudo -E pkg install -y xxhash liblz4 zstd pkgconf
# Install one of the FUSE libraries; fail if neither is available
sudo -E pkg install -y fusefs-libs || sudo -E pkg install -y fusefs-libs3
sudo -E pkg install -y rust
sudo -E pkg install -y git
sudo -E pkg install -y python310 py310-sqlite3
sudo -E pkg install -y python311 py311-sqlite3 py311-pip py311-virtualenv
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python3
sudo ln -sf /usr/local/bin/python3.11 /usr/local/bin/python
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip3
sudo ln -sf /usr/local/bin/pip3.11 /usr/local/bin/pip

python -m venv .venv
. .venv/bin/activate
python -V
pip -V
python -m pip install --upgrade pip wheel
pip install -r requirements.d/development.txt
pip install -e .
pytest -v -n auto --benchmark-skip

if [[ "${DO_BINARIES}" == "true" && "${GITHUB_REF:-}" == refs/tags/* ]]; then
python -m pip install 'pyinstaller==6.14.2'
mkdir -p dist/binary
pyinstaller --clean --distpath=dist/binary scripts/borg.exe.spec
pushd dist/binary
echo "single-file binary"
chmod +x borg.exe
./borg.exe -V
echo "single-directory binary"
chmod +x borg-dir/borg.exe
./borg-dir/borg.exe -V
tar czf borg.tgz borg-dir
popd
mkdir -p artifacts
if [ -f dist/binary/borg.exe ]; then
cp -v dist/binary/borg.exe artifacts/${{ matrix.artifact_prefix }}
fi
if [ -f dist/binary/borg.tgz ]; then
cp -v dist/binary/borg.tgz artifacts/${{ matrix.artifact_prefix }}.tgz
fi
fi
;;

netbsd)
arch="$(uname -m)"
sudo -E mkdir -p /usr/pkg/etc/pkgin
echo "http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/${arch}/10.1/All" | sudo tee /usr/pkg/etc/pkgin/repositories.conf > /dev/null
sudo -E pkgin update || true
sudo -E pkgin -y upgrade || true
sudo -E pkgin -y install zstd lz4 xxhash git || true
sudo -E pkgin -y install rust || true
sudo -E pkgin -y install pkg-config || true
sudo -E pkgin -y install py311-pip py311-virtualenv || true
sudo -E ln -sf /usr/pkg/bin/python3.11 /usr/pkg/bin/python3 || true
sudo -E ln -sf /usr/pkg/bin/pip3.11 /usr/pkg/bin/pip3 || true
sudo -E ln -sf /usr/pkg/bin/virtualenv-3.11 /usr/pkg/bin/virtualenv3 || true

python3 -m virtualenv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.d/development.txt
pip install -e .
pytest -v -n auto --benchmark-skip
;;

openbsd)
# echo "https://ftp.eu.openbsd.org/pub/OpenBSD" | sudo tee /etc/installurl > /dev/null || true
sudo -E pkg_add xxhash || true
sudo -E pkg_add lz4 || true
sudo -E pkg_add zstd || true
sudo -E pkg_add git || true
sudo -E pkg_add rust || true
sudo -E pkg_add openssl%3.4 || true
sudo -E pkg_add py3-pip || true
sudo -E pkg_add py3-virtualenv || true

export BORG_OPENSSL_NAME=eopenssl34
python3 -m virtualenv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.d/development.txt
pip install -e .
pytest -v -n auto --benchmark-skip
;;

haiku)
pkgman refresh || true
pkgman install -y git pkgconfig zstd lz4 xxhash || true
pkgman install -y openssl3 || true
pkgman install -y rust_bin || true
pkgman install -y python3.10 || true
pkgman install -y cffi || true
python3 -V || true
pkgman install -y lz4_devel zstd_devel xxhash_devel openssl3_devel libffi_devel || true
export PKG_CONFIG_PATH="/system/develop/lib/pkgconfig:/system/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export BORG_LIBLZ4_PREFIX=/system/develop
export BORG_LIBZSTD_PREFIX=/system/develop
export BORG_LIBXXHASH_PREFIX=/system/develop
export BORG_OPENSSL_PREFIX=/system/develop

python3 -m ensurepip --upgrade || true
python3 -m pip install --upgrade pip wheel
python3 -m venv .venv
. .venv/bin/activate
python -V
pip install -r requirements.d/development.txt
pip install -e .
pytest -v --benchmark-skip -k "not remote and not socket"
;;
esac

- name: Upload artifacts
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.version }}-dist
path: artifacts/*
if-no-files-found: ignore

- name: Attest provenance
if: startsWith(github.ref, 'refs/tags/') && matrix.do_binaries
uses: actions/attest-build-provenance@v3
with:
subject-path: 'artifacts/*'

windows_tests:

if: false # can be used to temporarily disable the build
runs-on: windows-latest
timeout-minutes: 120
needs: posix_tests
needs: native_tests

env:
PY_COLORS: 1
Expand Down
119 changes: 0 additions & 119 deletions .github/workflows/freebsd.yml

This file was deleted.

Loading
Loading