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'
|
|
|
|
- '**.cfg'
|
|
|
|
- '**.ini'
|
|
|
|
- 'requirements.d/*'
|
|
|
|
- '!docs/**'
|
2020-11-03 00:18:27 +00:00
|
|
|
pull_request:
|
2022-06-14 13:40:09 +00:00
|
|
|
branches: [ master, borg2 ]
|
2020-11-03 01:07:29 +00:00
|
|
|
paths:
|
|
|
|
- '**.py'
|
|
|
|
- '**.pyx'
|
|
|
|
- '**.c'
|
|
|
|
- '**.h'
|
|
|
|
- '**.yml'
|
|
|
|
- '**.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
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-05 17:35:00 +00:00
|
|
|
timeout-minutes: 10
|
2020-11-03 00:18:27 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-03 01:07:29 +00:00
|
|
|
- name: Set up Python
|
2020-11-03 00:18:27 +00:00
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
2022-02-25 23:13:19 +00:00
|
|
|
python-version: 3.9
|
2020-11-03 00:18:27 +00:00
|
|
|
- name: Lint with flake8
|
|
|
|
run: |
|
2020-11-03 01:07:29 +00:00
|
|
|
pip install flake8
|
2020-11-03 00:18:27 +00:00
|
|
|
flake8 src scripts conftest.py
|
2020-11-03 01:07:29 +00:00
|
|
|
|
|
|
|
pytest:
|
|
|
|
|
|
|
|
needs: lint
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2020-11-03 22:33:06 +00:00
|
|
|
- os: ubuntu-20.04
|
2021-02-16 18:07:50 +00:00
|
|
|
python-version: '3.9'
|
2022-02-25 23:13:19 +00:00
|
|
|
toxenv: py39-fuse2
|
2021-03-13 00:39:26 +00:00
|
|
|
- os: ubuntu-20.04
|
2022-01-06 22:33:45 +00:00
|
|
|
python-version: '3.10'
|
2021-03-13 00:39:26 +00:00
|
|
|
toxenv: py310-fuse3
|
2022-01-16 14:25:58 +00:00
|
|
|
- os: macos-10.15 # macos-latest is macos 11.6.2 and hanging at test_fuse, #6099
|
2022-02-25 23:13:19 +00:00
|
|
|
python-version: '3.9'
|
|
|
|
toxenv: py39-fuse2
|
2020-11-03 01:07:29 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
# Configure pkg-config to use OpenSSL from Homebrew
|
|
|
|
PKG_CONFIG_PATH: /usr/local/opt/openssl@1.1/lib/pkgconfig
|
2022-03-02 01:37:00 +00:00
|
|
|
BORG_LIBDEFLATE_PREFIX: /usr # on ubuntu 20.04 pkgconfig does not find libdeflate
|
2020-11-03 22:33:06 +00:00
|
|
|
TOXENV: ${{ matrix.toxenv }}
|
2020-11-03 01:07:29 +00:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-12-05 17:35:00 +00:00
|
|
|
timeout-minutes: 40
|
2020-11-03 01:07:29 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-03 21:57:15 +00:00
|
|
|
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 }}
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Cache pip
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.cache/pip
|
|
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.d/development.txt') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pip-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
|
|
|
- name: Install Linux packages
|
|
|
|
if: ${{ runner.os == 'Linux' }}
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-02-26 21:40:16 +00:00
|
|
|
sudo apt-get install -y pkg-config build-essential
|
2022-03-02 01:37:00 +00:00
|
|
|
sudo apt-get install -y libssl-dev libacl1-dev libxxhash-dev libdeflate-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 macOS packages
|
|
|
|
if: ${{ runner.os == 'macOS' }}
|
|
|
|
run: |
|
|
|
|
brew install pkg-config || brew upgrade pkg-config
|
|
|
|
brew install zstd || brew upgrade zstd
|
|
|
|
brew install lz4 || brew upgrade lz4
|
2022-03-02 01:37:00 +00:00
|
|
|
brew install libdeflate || brew upgrade libdeflate
|
2022-02-26 21:40:16 +00:00
|
|
|
brew install xxhash || brew upgrade xxhash
|
2020-11-03 01:07:29 +00:00
|
|
|
brew install openssl@1.1 || brew upgrade openssl@1.1
|
2022-01-16 14:25:58 +00:00
|
|
|
brew install --cask macfuse || brew upgrade --cask macfuse # Required for Python llfuse module
|
2020-11-03 01:07:29 +00: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: |
|
|
|
|
# pip install -e .
|
|
|
|
python setup.py -v develop
|
|
|
|
- name: run pytest via tox
|
|
|
|
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
|
|
|
|
uses: codecov/codecov-action@v1
|
2020-12-05 17:35:00 +00:00
|
|
|
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
|