2020-11-03 02:07:29 +01:00
|
|
|
# badge: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
|
|
|
|
|
2020-11-03 01:18:27 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
2020-11-03 02:07:29 +01:00
|
|
|
paths:
|
|
|
|
- '**.py'
|
|
|
|
- '**.pyx'
|
|
|
|
- '**.c'
|
|
|
|
- '**.h'
|
|
|
|
- '**.yml'
|
2023-11-27 17:23:36 +01:00
|
|
|
- '**.toml'
|
2020-11-03 02:07:29 +01:00
|
|
|
- '**.cfg'
|
|
|
|
- '**.ini'
|
|
|
|
- 'requirements.d/*'
|
|
|
|
- '!docs/**'
|
2020-11-03 01:18:27 +01:00
|
|
|
pull_request:
|
2023-06-28 15:27:26 +02:00
|
|
|
branches: [ master ]
|
2020-11-03 02:07:29 +01:00
|
|
|
paths:
|
|
|
|
- '**.py'
|
|
|
|
- '**.pyx'
|
|
|
|
- '**.c'
|
|
|
|
- '**.h'
|
|
|
|
- '**.yml'
|
2023-11-27 17:23:36 +01:00
|
|
|
- '**.toml'
|
2020-11-03 02:07:29 +01:00
|
|
|
- '**.cfg'
|
|
|
|
- '**.ini'
|
|
|
|
- 'requirements.d/*'
|
|
|
|
- '!docs/**'
|
2020-11-03 01:18:27 +01:00
|
|
|
|
|
|
|
jobs:
|
2020-11-03 02:07:29 +01:00
|
|
|
lint:
|
2020-11-03 01:18:27 +01:00
|
|
|
|
2023-08-26 14:40:53 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2024-02-09 00:22:16 +01:00
|
|
|
timeout-minutes: 5
|
2020-11-03 01:18:27 +01:00
|
|
|
|
|
|
|
steps:
|
2024-03-15 15:12:48 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-09-04 22:15:42 +02:00
|
|
|
- uses: chartboost/ruff-action@v1
|
2020-11-03 02:07:29 +01:00
|
|
|
|
2023-06-29 19:59:39 +02:00
|
|
|
linux:
|
2020-11-03 02:07:29 +01:00
|
|
|
|
|
|
|
needs: lint
|
|
|
|
strategy:
|
2022-12-10 17:32:23 +01:00
|
|
|
fail-fast: true
|
2020-11-03 02:07:29 +01:00
|
|
|
matrix:
|
|
|
|
include:
|
2023-08-26 14:40:53 +02:00
|
|
|
- os: ubuntu-22.04
|
2022-07-15 12:44:56 +02:00
|
|
|
python-version: '3.9'
|
|
|
|
toxenv: mypy
|
2023-08-26 14:40:53 +02:00
|
|
|
- os: ubuntu-22.04
|
2023-08-26 13:44:08 +02:00
|
|
|
python-version: '3.11'
|
|
|
|
toxenv: docs
|
2023-08-26 14:40:53 +02:00
|
|
|
- os: ubuntu-22.04
|
2021-02-16 19:07:50 +01:00
|
|
|
python-version: '3.9'
|
2022-02-26 00:13:19 +01:00
|
|
|
toxenv: py39-fuse2
|
2023-08-26 14:40:53 +02:00
|
|
|
- os: ubuntu-22.04
|
2022-01-06 23:33:45 +01:00
|
|
|
python-version: '3.10'
|
2021-03-13 01:39:26 +01:00
|
|
|
toxenv: py310-fuse3
|
2023-08-26 14:40:53 +02:00
|
|
|
- os: ubuntu-22.04
|
2022-10-27 02:15:05 +02:00
|
|
|
python-version: '3.11'
|
2022-09-28 02:57:20 +02:00
|
|
|
toxenv: py311-fuse3
|
2024-08-28 03:34:46 +02:00
|
|
|
- os: ubuntu-24.04
|
2023-10-10 17:38:39 +02:00
|
|
|
python-version: '3.12'
|
2023-05-19 22:14:41 +02:00
|
|
|
toxenv: py312-fuse3
|
2024-08-28 03:34:46 +02:00
|
|
|
- os: ubuntu-24.04
|
|
|
|
python-version: '3.13-dev'
|
|
|
|
toxenv: py313-fuse3
|
2020-11-03 02:07:29 +01:00
|
|
|
|
|
|
|
env:
|
2020-11-03 23:33:06 +01:00
|
|
|
TOXENV: ${{ matrix.toxenv }}
|
2020-11-03 02:07:29 +01:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
2024-02-09 00:22:16 +01:00
|
|
|
timeout-minutes: 120
|
2020-11-03 02:07:29 +01:00
|
|
|
|
|
|
|
steps:
|
2024-03-15 15:12:48 +01:00
|
|
|
- uses: actions/checkout@v4
|
2020-11-03 22:57:15 +01:00
|
|
|
with:
|
|
|
|
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
|
|
|
|
fetch-depth: 0
|
2020-11-03 02:07:29 +01:00
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-04-03 17:47:56 +02:00
|
|
|
uses: actions/setup-python@v5
|
2020-11-03 02:07:29 +01:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Cache pip
|
2024-04-03 17:47:56 +02:00
|
|
|
uses: actions/cache@v4
|
2020-11-03 02:07:29 +01:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
|
|
|
- name: Install Linux packages
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-02-26 22:40:16 +01:00
|
|
|
sudo apt-get install -y pkg-config build-essential
|
2022-07-04 20:26:42 +02:00
|
|
|
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
|
2020-11-03 02:07:29 +01:00
|
|
|
sudo apt-get install -y libfuse-dev fuse || true # Required for Python llfuse module
|
|
|
|
sudo apt-get install -y libfuse3-dev fuse3 || true # Required for Python pyfuse3 module
|
|
|
|
|
2023-06-29 19:59:39 +02:00
|
|
|
- name: Install Python requirements
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
|
|
pip install -r requirements.d/development.txt
|
|
|
|
- name: Install borgbackup
|
|
|
|
run: |
|
2024-08-04 15:57:37 +02:00
|
|
|
pip install -e .
|
2023-06-29 19:59:39 +02:00
|
|
|
- name: run tox env
|
|
|
|
env:
|
|
|
|
XDISTN: "4"
|
|
|
|
run: |
|
|
|
|
# do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
|
|
|
|
#sudo -E bash -c "tox -e py"
|
|
|
|
tox --skip-missing-interpreters
|
|
|
|
- name: Upload coverage to Codecov
|
2024-04-03 17:47:56 +02:00
|
|
|
uses: codecov/codecov-action@v4
|
2023-06-29 19:59:39 +02:00
|
|
|
env:
|
|
|
|
OS: ${{ runner.os }}
|
|
|
|
python: ${{ matrix.python-version }}
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
env_vars: OS, python
|
|
|
|
|
|
|
|
macOS:
|
|
|
|
|
|
|
|
needs: linux
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
include:
|
2024-03-15 15:12:48 +01:00
|
|
|
- os: macos-14
|
2023-06-29 19:59:39 +02:00
|
|
|
python-version: '3.11'
|
|
|
|
toxenv: py311-none # note: no fuse testing, due to #6099, see also #6196.
|
|
|
|
|
|
|
|
env:
|
|
|
|
# Configure pkg-config to use OpenSSL from Homebrew
|
2024-05-12 14:59:02 +02:00
|
|
|
PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2023-06-29 19:59:39 +02:00
|
|
|
TOXENV: ${{ matrix.toxenv }}
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
2024-02-09 00:22:16 +01:00
|
|
|
timeout-minutes: 180
|
2023-06-29 19:59:39 +02:00
|
|
|
|
|
|
|
steps:
|
2024-03-15 15:12:48 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-29 19:59:39 +02:00
|
|
|
with:
|
|
|
|
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-03-15 15:12:48 +01:00
|
|
|
uses: actions/setup-python@v5
|
2023-06-29 19:59:39 +02:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Cache pip
|
2024-03-15 15:12:48 +01:00
|
|
|
uses: actions/cache@v4
|
2023-06-29 19:59:39 +02:00
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
2020-11-03 02:07:29 +01:00
|
|
|
- name: Install macOS packages
|
2021-11-13 19:21:59 -08:00
|
|
|
run: brew bundle install
|
2020-11-03 02:07:29 +01:00
|
|
|
|
|
|
|
- name: Install Python requirements
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
|
|
|
pip install -r requirements.d/development.txt
|
|
|
|
- name: Install borgbackup
|
2022-12-17 19:58:02 +01:00
|
|
|
env:
|
|
|
|
# we already have that in the global env, but something is broken and overwrites that.
|
|
|
|
# so, set it here, again.
|
2024-05-12 14:59:02 +02:00
|
|
|
PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2020-11-03 02:07:29 +01:00
|
|
|
run: |
|
2024-03-15 15:12:48 +01:00
|
|
|
pip install -ve .
|
2022-07-15 12:44:56 +02:00
|
|
|
- name: run tox env
|
2022-12-17 19:58:02 +01:00
|
|
|
env:
|
|
|
|
# we already have that in the global env, but something is broken and overwrites that.
|
|
|
|
# so, set it here, again.
|
2024-05-12 14:59:02 +02:00
|
|
|
PKG_CONFIG_PATH: "/opt/homebrew/opt/openssl@3.0/lib/pkgconfig:$PKG_CONFIG_PATH"
|
2023-06-29 19:59:39 +02:00
|
|
|
XDISTN: "6"
|
2020-11-03 02:07:29 +01:00
|
|
|
run: |
|
|
|
|
# do not use fakeroot, but run as root. avoids the dreaded EISDIR sporadic failures. see #2482.
|
|
|
|
#sudo -E bash -c "tox -e py"
|
2020-11-03 23:33:06 +01:00
|
|
|
tox --skip-missing-interpreters
|
2020-12-03 02:00:35 -06:00
|
|
|
- name: Upload coverage to Codecov
|
2024-03-15 15:12:48 +01:00
|
|
|
uses: codecov/codecov-action@v4
|
2020-12-05 18:35:00 +01:00
|
|
|
env:
|
2020-12-03 02:00:35 -06:00
|
|
|
OS: ${{ runner.os }}
|
|
|
|
python: ${{ matrix.python-version }}
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
env_vars: OS, python
|
2023-06-01 20:24:45 +01:00
|
|
|
|
|
|
|
windows:
|
|
|
|
|
2024-10-15 20:36:17 +02:00
|
|
|
if: false # build temporary disabled
|
2023-06-01 20:24:45 +01:00
|
|
|
runs-on: windows-latest
|
2024-02-09 00:22:16 +01:00
|
|
|
timeout-minutes: 120
|
2023-06-29 19:59:39 +02:00
|
|
|
needs: linux
|
2023-06-01 20:24:45 +01:00
|
|
|
|
|
|
|
env:
|
2024-09-19 12:36:18 +02:00
|
|
|
# Needed for setuptools < 70.2.0 to work, see: https://www.msys2.org/docs/python/#known-issues
|
|
|
|
# SETUPTOOLS_USE_DISTUTILS: stdlib
|
2023-06-01 20:24:45 +01:00
|
|
|
PY_COLORS: 1
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
|
|
|
|
steps:
|
2024-03-15 15:12:48 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-01 20:24:45 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
msystem: UCRT64
|
|
|
|
update: true
|
|
|
|
- name: Install dependencies
|
|
|
|
run: ./scripts/msys2-install-deps development
|
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-12-24 18:22:31 +01:00
|
|
|
# build borg.exe
|
2024-09-19 12:36:18 +02:00
|
|
|
pip install -e .
|
2023-06-01 20:24:45 +01:00
|
|
|
pyinstaller -y scripts/borg.exe.spec
|
2023-12-24 18:22:31 +01:00
|
|
|
# build sdist and wheel in dist/...
|
2024-09-19 12:36:18 +02:00
|
|
|
python -m build
|
2024-03-15 15:12:48 +01:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-06-01 20:24:45 +01:00
|
|
|
with:
|
|
|
|
name: borg-windows
|
|
|
|
path: dist/borg.exe
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
./dist/borg.exe -V
|
2023-06-01 23:32:12 +02:00
|
|
|
pytest -n4 --benchmark-skip -vv -rs -k "not remote"
|