borg/.github/workflows/ci.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

239 lines
6.7 KiB
YAML
Raw Normal View History

2020-11-03 01:07:29 +00:00
# badge: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
2020-11-03 00:18:27 +00:00
name: CI
on:
push:
branches: [ master ]
2020-11-03 01:07:29 +00:00
paths:
- '**.py'
- '**.pyx'
- '**.c'
- '**.h'
- '**.yml'
- '**.toml'
2020-11-03 01:07:29 +00:00
- '**.cfg'
- '**.ini'
- 'requirements.d/*'
- '!docs/**'
2020-11-03 00:18:27 +00:00
pull_request:
2023-06-28 13:27:26 +00:00
branches: [ master ]
2020-11-03 01:07:29 +00:00
paths:
- '**.py'
- '**.pyx'
- '**.c'
- '**.h'
- '**.yml'
- '**.toml'
2020-11-03 01:07:29 +00:00
- '**.cfg'
- '**.ini'
- 'requirements.d/*'
- '!docs/**'
2020-11-03 00:18:27 +00:00
jobs:
2020-11-03 01:07:29 +00:00
lint:
2020-11-03 00:18:27 +00:00
2023-08-26 12:40:53 +00:00
runs-on: ubuntu-22.04
2023-09-04 20:15:42 +00:00
timeout-minutes: 2
2020-11-03 00:18:27 +00:00
steps:
2022-12-17 19:31:13 +00:00
- uses: actions/checkout@v3
2023-09-04 20:15:42 +00:00
- uses: chartboost/ruff-action@v1
2020-11-03 01:07:29 +00:00
linux:
2020-11-03 01:07:29 +00:00
needs: lint
strategy:
fail-fast: true
2020-11-03 01:07:29 +00:00
matrix:
include:
2023-08-26 12:40:53 +00:00
- os: ubuntu-22.04
python-version: '3.9'
toxenv: mypy
2023-08-26 12:40:53 +00:00
- os: ubuntu-22.04
2023-08-26 11:44:08 +00:00
python-version: '3.11'
toxenv: docs
2023-08-26 12:40:53 +00:00
- os: ubuntu-22.04
python-version: '3.9'
2022-02-25 23:13:19 +00:00
toxenv: py39-fuse2
2023-08-26 12:40:53 +00:00
- os: ubuntu-22.04
2022-01-06 22:33:45 +00:00
python-version: '3.10'
2021-03-13 00:39:26 +00:00
toxenv: py310-fuse3
2023-08-26 12:40:53 +00:00
- os: ubuntu-22.04
2022-10-27 00:15:05 +00:00
python-version: '3.11'
2022-09-28 00:57:20 +00:00
toxenv: py311-fuse3
2023-05-19 20:14:41 +00:00
- os: ubuntu-22.04
2023-10-10 15:38:39 +00:00
python-version: '3.12'
2023-05-19 20:14:41 +00:00
toxenv: py312-fuse3
2020-11-03 01:07:29 +00:00
env:
2020-11-03 22:33:06 +00:00
TOXENV: ${{ matrix.toxenv }}
2020-11-03 01:07:29 +00:00
runs-on: ${{ matrix.os }}
timeout-minutes: 60
2020-11-03 01:07:29 +00:00
steps:
2022-12-17 19:31:13 +00:00
- uses: actions/checkout@v3
with:
# just fetching 1 commit is not enough for setuptools-scm, so we fetch all
fetch-depth: 0
2020-11-03 01:07:29 +00:00
- name: Set up Python ${{ matrix.python-version }}
2022-12-17 19:31:58 +00:00
uses: actions/setup-python@v4
2020-11-03 01:07:29 +00:00
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
2022-12-17 19:32:35 +00:00
uses: actions/cache@v3
2020-11-03 01:07:29 +00: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
sudo apt-get install -y pkg-config build-essential
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev liblz4-dev libzstd-dev
2020-11-03 01:07:29 +00: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
- name: Install Python requirements
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.d/development.txt
- name: Install borgbackup
run: |
# pip install -e .
python setup.py -v develop
- 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
uses: codecov/codecov-action@v3
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:
- os: macos-12
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
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
TOXENV: ${{ matrix.toxenv }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
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 }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
2020-11-03 01:07:29 +00:00
- name: Install macOS packages
run: |
brew install pkg-config || brew upgrade pkg-config
brew install zstd || brew upgrade zstd
brew install lz4 || brew upgrade lz4
brew install xxhash || brew upgrade xxhash
2020-11-03 01:07:29 +00:00
brew install openssl@1.1 || brew upgrade openssl@1.1
- name: Install Python requirements
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.d/development.txt
- name: Install borgbackup
env:
# we already have that in the global env, but something is broken and overwrites that.
# so, set it here, again.
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
2020-11-03 01:07:29 +00:00
run: |
pip install -e .
- name: run tox env
env:
# we already have that in the global env, but something is broken and overwrites that.
# so, set it here, again.
PKG_CONFIG_PATH: "/usr/local/opt/openssl@1.1/lib/pkgconfig:$PKG_CONFIG_PATH"
XDISTN: "6"
2020-11-03 01:07:29 +00: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 22:33:06 +00:00
tox --skip-missing-interpreters
2020-12-03 08:00:35 +00:00
- name: Upload coverage to Codecov
2023-02-09 17:46:36 +00:00
uses: codecov/codecov-action@v3
env:
2020-12-03 08:00:35 +00:00
OS: ${{ runner.os }}
python: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS, python
windows:
runs-on: windows-latest
timeout-minutes: 60
needs: linux
env:
SETUPTOOLS_USE_DISTUTILS: stdlib # Needed for pip to work - https://www.msys2.org/docs/python/#known-issues
PY_COLORS: 1
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
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: |
# build borg.exe
SETUPTOOLS_USE_DISTUTILS=stdlib pip install -e .
pyinstaller -y scripts/borg.exe.spec
# build sdist and wheel in dist/...
SETUPTOOLS_USE_DISTUTILS=stdlib python -m build
- uses: actions/upload-artifact@v3
with:
name: borg-windows
path: dist/borg.exe
- name: Run tests
run: |
./dist/borg.exe -V
pytest -n4 --benchmark-skip -vv -rs -k "not remote"