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
Manu 52233a9844
Fix flaky tests (#788)
* New DB for each test, hopefully takes care of race condition when using new DB.
* Centralize timeout setting
2021-02-17 10:14:58 +08:00

78 lines
2.4 KiB
YAML

name: Test
on: [push, pull_request]
jobs:
test:
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt install -y \
xvfb herbstluftwm libssl-dev openssl libacl1-dev libacl1 build-essential \
libxkbcommon-x11-0 dbus-x11 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \
libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew upgrade openssl readline xz # pyenv pyenv-virtualenv
- name: Install Vorta
run: |
pip install .
pip install borgbackup
pip install -r requirements.d/dev.txt
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1
- name: Test with pytest (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile \
--background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
sleep 3
export $(dbus-launch)
(herbstluftwm) &
sleep 3
coverage run -m pytest
- name: Test with pytest (macOS)
if: runner.os == 'macOS'
run: |
coverage run -m pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
env:
OS: ${{ runner.os }}
python: ${{ matrix.python-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS, python
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Vorta
run: |
pip install .
pip install -r requirements.d/dev.txt
- name: Run Flake8
run: flake8
# - name: Run PyLint (info only)
# run: pylint --rcfile=setup.cfg src --exit-zero