mirror of
https://github.com/borgbackup/borg.git
synced 2026-04-15 21:59:58 -04:00
backport github ci workflow
This commit is contained in:
parent
4407807198
commit
3e50a07d66
1 changed files with 127 additions and 0 deletions
127
.github/workflows/ci.yml
vendored
Normal file
127
.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
# badge: https://github.com/borgbackup/borg/workflows/CI/badge.svg?branch=master
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '**.py'
|
||||
- '**.pyx'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**.yml'
|
||||
- '**.cfg'
|
||||
- '**.ini'
|
||||
- 'requirements.d/*'
|
||||
- '!docs/**'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- '**.py'
|
||||
- '**.pyx'
|
||||
- '**.c'
|
||||
- '**.h'
|
||||
- '**.yml'
|
||||
- '**.cfg'
|
||||
- '**.ini'
|
||||
- 'requirements.d/*'
|
||||
- '!docs/**'
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
pip install flake8
|
||||
flake8 src scripts conftest.py
|
||||
|
||||
pytest:
|
||||
|
||||
needs: lint
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
python-version: 3.6
|
||||
toxenv: py36-fuse2
|
||||
- os: ubuntu-20.04
|
||||
python-version: 3.7
|
||||
toxenv: py37-fuse2
|
||||
- os: ubuntu-20.04
|
||||
python-version: 3.8
|
||||
toxenv: py38-fuse3
|
||||
- os: ubuntu-20.04
|
||||
python-version: 3.9
|
||||
toxenv: py39-fuse3
|
||||
- os: macos-latest
|
||||
# note: it seems that 3.8 and 3.9 are currently broken,
|
||||
# neverending RuntimeError crashes...
|
||||
python-version: 3.7
|
||||
toxenv: py37-fuse2
|
||||
|
||||
env:
|
||||
# Configure pkg-config to use OpenSSL from Homebrew
|
||||
PKG_CONFIG_PATH: /usr/local/opt/openssl@1.1/lib/pkgconfig
|
||||
TOXENV: ${{ matrix.toxenv }}
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
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@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
|
||||
sudo apt-get install -y libssl-dev libacl1-dev liblz4-dev libzstd-dev pkg-config build-essential
|
||||
sudo apt-get install -y libxxhash-dev || true
|
||||
sudo apt-get install -y libb2-dev || true
|
||||
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
|
||||
brew install openssl@1.1 || brew upgrade openssl@1.1
|
||||
brew install Caskroom/cask/osxfuse || brew upgrade Caskroom/cask/osxfuse # Required for Python llfuse 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 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"
|
||||
tox --skip-missing-interpreters
|
||||
Loading…
Reference in a new issue