diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 14056c11..a00fe57b 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,13 +14,20 @@ jobs: runs-on: [self-hosted, linux, x64, gpu] container: image: ubuntu - permissions: - # Allow publishing new comments on PRs - pull-requests: write - # Allow for editing existing comments - contents: write + permissions: # Read the action that triggered this one actions: read + # Allow to write check runs + checks: write + # Allow for editing existing comments + contents: write + # Allow publishing new comments on PRs + pull-requests: write + # Read and update commit statuses + statuses: write + + + # Allow to check commit statusses steps: - name: Download Artifact uses: actions/download-artifact@v4 @@ -37,3 +44,9 @@ jobs: path: coverage.xml repo_token: ${{ secrets.GITHUB_TOKEN }} pull_request_number: ${{ steps.get-pr.outputs.PR }} + minimum_coverage: 80 + show_missing: True + fail_below_threshold: True + link_missing_lines: True + # False for now, might set to true later + only_changed_files: False diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1f84ef28..c733226c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,18 +27,17 @@ jobs: run: | conda install -y -c conda-forge python=3 cupy cuda-version=11.8 python -m pip install coverage - - name: Install code and list dependencies + - name: Install code and list dependencies run: | - python -m pip install .[plotting] + python -m pip install -e .[plotting] conda list - name: Run tests and generate coverage run: | - cd tests - coverage run -m unittest discover - coverage xml coverage.xml + coverage run -m unittest discover tests/ + coverage xml echo ${{ github.event.number }} > coverage.PR - name: upload coverage report uses: actions/upload-artifact@v4 with: - path: tests/coverage.* + path: coverage.* name: coverage