From 7b90931f7b9471d4b7ee31a379427418d20bb629 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 10:39:31 -0500 Subject: [PATCH 1/8] fix handling of cov files --- .github/actions/upload-coverage/action.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/actions/upload-coverage/action.yml b/.github/actions/upload-coverage/action.yml index 4c572ca..3cc64f1 100644 --- a/.github/actions/upload-coverage/action.yml +++ b/.github/actions/upload-coverage/action.yml @@ -1,16 +1,18 @@ name: "Upload Coverage" description: "Upload the coverage report(s) for this job" -inputs: - file_pattern: - description: "The coverage file pattern" - default: ".coverage" runs: using: "composite" steps: + - name: Rename coverage file + - shell: bash + run: | + if [ -f ".coverage" ]; then + mv .coverage ".coverage.-$$-$RANDOM" + fi - name: Upload coverage data uses: actions/upload-artifact@v3 with: name: coverage-data - path: ${{inputs.file_pattern}} + path: ".coverage.*" if-no-files-found: ignore From 0661e6b78586db84a0d191ba6bd993fb222a7bb6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 10:41:04 -0500 Subject: [PATCH 2/8] fix handling of cov files --- .github/actions/upload-coverage/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/upload-coverage/action.yml b/.github/actions/upload-coverage/action.yml index 3cc64f1..aa9f915 100644 --- a/.github/actions/upload-coverage/action.yml +++ b/.github/actions/upload-coverage/action.yml @@ -5,7 +5,7 @@ runs: using: "composite" steps: - name: Rename coverage file - - shell: bash + shell: bash run: | if [ -f ".coverage" ]; then mv .coverage ".coverage.-$$-$RANDOM" From 10e1fc38fda21c1e28c2bfe78bc86037878dc5e3 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 10:42:31 -0500 Subject: [PATCH 3/8] fix handling of cov files --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e143f9b..53048de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -280,7 +280,10 @@ jobs: coverage_test: name: Test coverage - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 - uses: ./.github/actions/base-setup From f1da98caec18f25197facc47597616ca30990ed6 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 10:47:47 -0500 Subject: [PATCH 4/8] stop doing double checkout --- .github/workflows/tests.yml | 1 - README.md | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 53048de..f007ea9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -298,7 +298,6 @@ jobs: needs: coverage_test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: ./.github/actions/report-coverage tests_check: # This job does nothing and is only used for the branch protection diff --git a/README.md b/README.md index 91dfd2a..cbc0689 100644 --- a/README.md +++ b/README.md @@ -392,7 +392,6 @@ jobs: needs: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1 with: fail_under: 90 From 1eb324ca7836572060341fd1ae12368e34dd1f2d Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 11:02:47 -0500 Subject: [PATCH 5/8] try again --- .github/actions/report-coverage/action.yml | 1 - .github/workflows/tests.yml | 1 + README.md | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/report-coverage/action.yml b/.github/actions/report-coverage/action.yml index 983bb9f..73b1c5b 100644 --- a/.github/actions/report-coverage/action.yml +++ b/.github/actions/report-coverage/action.yml @@ -8,7 +8,6 @@ inputs: runs: using: "composite" steps: - - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: # Use latest Python, so it understands all syntax. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f007ea9..53048de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -298,6 +298,7 @@ jobs: needs: coverage_test runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: ./.github/actions/report-coverage tests_check: # This job does nothing and is only used for the branch protection diff --git a/README.md b/README.md index cbc0689..91dfd2a 100644 --- a/README.md +++ b/README.md @@ -392,6 +392,7 @@ jobs: needs: test runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - uses: jupyterlab/maintainer-tools/.github/actions/report-coverage@v1 with: fail_under: 90 From 483640aa64757b0163c9c25efbeee946bd74e629 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 12:26:24 -0500 Subject: [PATCH 6/8] try with relative_files --- .github/workflows/tests.yml | 2 +- pyproject.toml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 53048de..31e4cd4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -288,7 +288,7 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/base-setup - run: | - pip install coverage pytest + pip install coverage[toml] pytest python -m coverage run -m pytest foobar.py ls -a - uses: ./.github/actions/upload-coverage diff --git a/pyproject.toml b/pyproject.toml index 2f4158e..aa6e4c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,3 +97,7 @@ unfixable = [ # Don't touch noqa lines "RUF100", ] + +[tool.coverage.run] +relative_files = true +source = "foobar.py" From b9abb0036d6fc40625c974f82c5b0be44aeae4ca Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 12:59:08 -0500 Subject: [PATCH 7/8] try again --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index aa6e4c3..545a289 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,4 +100,4 @@ unfixable = [ [tool.coverage.run] relative_files = true -source = "foobar.py" +source = ["foobar.py"] From 7f14b93f5474484ca5f43c2696ae6f2231ed246c Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 13 Apr 2023 14:29:16 -0500 Subject: [PATCH 8/8] fix source name --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 545a289..8413116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,4 +100,4 @@ unfixable = [ [tool.coverage.run] relative_files = true -source = ["foobar.py"] +source = ["foobar"]