From 05b93cbab3b31d37e16487f95cd81cafe3990096 Mon Sep 17 00:00:00 2001 From: Brian Tambara Date: Sat, 20 Apr 2024 11:57:09 -0700 Subject: [PATCH 1/2] add pytest coverage badge --- .github/workflows/pytest.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index fe70c9d..55a84e0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -17,4 +17,9 @@ jobs: pip install -r setup/requirements.txt -r setup/development/requirements.txt - name: Test with pytest run: | - pytest --cov-report term-missing --cov=api api/src + pytest --junitxml pytest.xml --cov-report term-missing --cov=api api/src | tee pytest-coverage.txt + - name: Pytest coverage comment + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: ./pytest-coverage.txt + junitxml-path: ./pytest.xml From 16670c040e6dc6cc37e69b95c55b3212b3766293 Mon Sep 17 00:00:00 2001 From: Brian Tambara Date: Sat, 20 Apr 2024 12:01:31 -0700 Subject: [PATCH 2/2] add permissions to write-all, add badge-title --- .github/workflows/pytest.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 55a84e0..a735d5e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,6 +7,7 @@ on: jobs: pytest: + permissions: write-all runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -23,3 +24,4 @@ jobs: with: pytest-coverage-path: ./pytest-coverage.txt junitxml-path: ./pytest.xml + badge-title: pytest Coverage