name: "PyTest & Codecov | Testing and Code Coverage" on: push: branches: [dev] pull_request: types: [opened, reopened, edited, synchronize] workflow_dispatch: env: default_branch: dev jobs: pytest: name: pytest runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.11.6" - name: Install project dependencies run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Run pytest uses: pavelzw/pytest-action@v2 with: custom-arguments: "--cov --cov-report=xml" env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}