1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-23 00:07:58 +00:00
vorta/.github/workflows/test.yml

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

98 lines
2.8 KiB
YAML
Raw Normal View History

name: Test
on:
push:
pull_request:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled'
required: false
default: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@2c3dd9e7e29afd70cc0950079bde6c979d1f69f9 # v4.3.1
with:
python-version: 3.8
- name: Install Vorta
run: |
pip install .
pip install -r requirements.d/dev.txt
- name: Test formatting with Flake8, isort and Black
run: make lint
# - name: Run PyLint (info only)
# run: pylint --rcfile=setup.cfg src --exit-zero
test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
2022-12-23 16:25:35 +00:00
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@2c3dd9e7e29afd70cc0950079bde6c979d1f69f9 # v4.3.1
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg', 'requirements.d/**') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install -y \
xvfb libssl-dev openssl libacl1-dev libacl1 build-essential borgbackup \
libxkbcommon-x11-0 dbus-x11 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libxcb-shape0
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install openssl readline xz borgbackup
- name: Install Vorta
run: |
pip install -e .
pip install -r requirements.d/dev.txt
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- name: Test with pytest (Linux)
if: runner.os == 'Linux'
run: |
xvfb-run --server-args="-screen 0 1024x768x24+32" \
-a dbus-run-session -- make test
- name: Test with pytest (macOS)
if: runner.os == 'macOS'
run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
2021-01-20 04:59:37 +00:00
env:
OS: ${{ runner.os }}
python: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS, python