name: Tests on: pull_request: branches: [master] push: branches: [master] jobs: test-backend: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.7', '3.8', '3.9', '3.10'] env: PYTHON: ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 - uses: dorny/paths-filter@v2 id: filter with: filters: | backend: - 'upnpavcontrol/**' - 'tests/**' - 'setup.cfg' - 'pyproject.toml' - 'poetry.lock' - '.github/workflows/*' - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 if: steps.filter.outputs.backend == 'true' with: python-version: ${{ matrix.python-version }} - name: Install dependencies if: steps.filter.outputs.backend == 'true' run: | python -m pip install --upgrade poetry poetry install - name: Lint with flake8 if: steps.filter.outputs.backend == 'true' run: | poetry run flake8 upnpavcontrol --statistics - name: Test with pytest if: steps.filter.outputs.backend == 'true' run: | poetry run pytest --cov=./ --cov-report=xml - name: Upload coverage to Codecov if: steps.filter.outputs.backend == 'true' uses: codecov/codecov-action@v3 with: file: ./coverage.xml flags: backend env_vars: PYTHON fail_ci_if_error: true