From 96abb4dbefe0eed52d5dd8c99bfb03b7725437bb Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 1 Nov 2024 20:16:10 -0400 Subject: [PATCH 1/3] Add codecov report upload --- .github/workflows/_tests-on-pr.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_tests-on-pr.yml b/.github/workflows/_tests-on-pr.yml index b3a64cd..aab3c23 100644 --- a/.github/workflows/_tests-on-pr.yml +++ b/.github/workflows/_tests-on-pr.yml @@ -18,6 +18,10 @@ on: default: false required: false type: boolean + secrets: + CODECOV_TOKEN: + description: 'Codecov token' + required: true jobs: validate: @@ -64,6 +68,14 @@ jobs: run: | if ${{ inputs.headless }}; then export DISPLAY=:99 - fi - python -m pytest + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + verbose: true + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} From 765d5e107ea617e464168bbb8ae0d8dbe3b63a8b Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 1 Nov 2024 20:17:44 -0400 Subject: [PATCH 2/3] Add secrets.Codecov to test-on-pr.yml temp --- .github/workflows/templates/tests-on-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/templates/tests-on-pr.yml b/.github/workflows/templates/tests-on-pr.yml index 2e90997..00e2834 100644 --- a/.github/workflows/templates/tests-on-pr.yml +++ b/.github/workflows/templates/tests-on-pr.yml @@ -14,3 +14,5 @@ jobs: project: {{ PROJECT/PROJECT_NAME }} c_extension: {{ C_EXTENSION/false }} headless: {{ HEADLESS/false }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 4eb571854a03feab5e8b779af07c9f73a04ff8e9 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 1 Nov 2024 20:22:34 -0400 Subject: [PATCH 3/3] Apply pre-commit --- .github/workflows/_tests-on-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/_tests-on-pr.yml b/.github/workflows/_tests-on-pr.yml index aab3c23..44a2ec0 100644 --- a/.github/workflows/_tests-on-pr.yml +++ b/.github/workflows/_tests-on-pr.yml @@ -72,7 +72,7 @@ jobs: pytest --cov coverage report -m codecov - + - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 with: