name: Test on: push: pull_request: workflow_dispatch: inputs: debug_enabled: type: boolean description: "Run the build with tmate debugging enabled" required: false default: false jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Setup python, vorta and dev deps uses: ./.github/actions/setup with: python-version: 3.11 pre-commit: true - name: Test formatting with Flake8, ruff and Black shell: bash run: make lint test-unit: timeout-minutes: 20 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest, macos-latest] borg-version: ["1.2.4"] steps: - uses: actions/checkout@v3 - name: Install system dependencies uses: ./.github/actions/install-dependencies - name: Setup python, vorta and dev deps uses: ./.github/actions/setup with: python-version: ${{ matrix.python-version }} install-nox: true - name: Setup tmate session uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - name: Run Unit Tests with pytest (Linux) if: runner.os == 'Linux' env: BORG_VERSION: ${{ matrix.borg-version }} run: | xvfb-run --server-args="-screen 0 1024x768x24+32" \ -a dbus-run-session -- make test-unit - name: Run Unit Tests with pytest (macOS) if: runner.os == 'macOS' env: BORG_VERSION: ${{ matrix.borg-version }} PKG_CONFIG_PATH: /usr/local/opt/openssl@3/lib/pkgconfig run: echo $PKG_CONFIG_PATH && make test-unit - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 env: OS: ${{ runner.os }} python: ${{ matrix.python-version }} with: token: ${{ secrets.CODECOV_TOKEN }} env_vars: OS, python test-integration: timeout-minutes: 20 runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] os: [ubuntu-latest, macos-latest] borg-version: ["1.1.18", "1.2.2", "1.2.4", "2.0.0b5"] exclude: - borg-version: "2.0.0b5" python-version: "3.8" steps: - uses: actions/checkout@v3 - name: Install system dependencies uses: ./.github/actions/install-dependencies - name: Setup python, vorta and dev deps uses: ./.github/actions/setup with: python-version: ${{ matrix.python-version }} install-nox: true - name: Setup tmate session uses: mxschmitt/action-tmate@v3 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - name: Run Integration Tests with pytest (Linux) if: runner.os == 'Linux' env: BORG_VERSION: ${{ matrix.borg-version }} run: | xvfb-run --server-args="-screen 0 1024x768x24+32" \ -a dbus-run-session -- make test-integration - name: Run Integration Tests with pytest (macOS) if: runner.os == 'macOS' env: BORG_VERSION: ${{ matrix.borg-version }} PKG_CONFIG_PATH: /usr/local/opt/openssl@3/lib/pkgconfig run: echo $PKG_CONFIG_PATH && make test-integration - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 env: OS: ${{ runner.os }} python: ${{ matrix.python-version }} with: token: ${{ secrets.CODECOV_TOKEN }} env_vars: OS, python