name: Code coverage on: pull_request: branches: - '*' jobs: comment_coverage: runs-on: ubuntu-latest steps: - name: GH_TOKEN if: env.GH_TOKEN == '' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV - name: ๐Ÿ”€ checkout uses: actions/checkout@v4 with: fetch-depth: 0 token: "${{ env.GH_TOKEN }}" - name: ๐Ÿ python uses: actions/setup-python@v5 with: python-version: '3.x' - name: ๐Ÿ“ฆ setup pdm uses: pdm-project/setup-pdm@v4 with: cache: true - name: ๐Ÿ“ฆ install dependencies run: | pdm install - name: configure git run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - name: ๐Ÿงช run coverage run: | pdm run pytest --cov --junitxml=pytest.xml --cov-report=term-missing | tee pytest-coverage.txt - name: ๐Ÿ“Š comment coverage uses: MishaKav/pytest-coverage-comment@main with: pytest-coverage-path: pytest-coverage.txt junitxml-path: pytest.xml