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] exclude: # Only test Python 3.7 on macOS - os: macos-latest python-version: 3.6 - os: macos-latest python-version: 3.8 - os: macos-latest python-version: 3.9 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