From 091137b8e90fa4739002b54659fe7b9c0c9ed3bb Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:07:54 +0100 Subject: [PATCH 01/25] dummy commit to try comments on PR --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 3979400..8fd1cd1 100644 --- a/src/main.py +++ b/src/main.py @@ -1,5 +1,5 @@ def main(): - print("Hello from python-template!") + print("Hello from python-basic-template!") if __name__ == "__main__": From 45a37548f969fe2a3bc93b0738949b8c8d9cdd98 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:19:23 +0100 Subject: [PATCH 02/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 13 ++++++++++--- Makefile | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 76dd9b1..d7f381a 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -1,13 +1,20 @@ -name: Comment on PR +name: Report test coverage on PR on: pull_request: branches: [ "main" ] jobs: - comment: + comment-test-coverage: runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Test + run: make test-gha >> "$GITHUB_OUTPUT" + - uses: actions/github-script@v7 with: github-token: ${{secrets.GHA_PRS}} @@ -16,5 +23,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: '👋 Thanks for reporting!' + body: $GITHUB_OUTPUT }) diff --git a/Makefile b/Makefile index e81b8e3..378d2cb 100644 --- a/Makefile +++ b/Makefile @@ -9,3 +9,7 @@ test-report-mac: .PHONY: test-report-win test-report-win: start htmlcov/index.html + +.PHONY: test-gha +test-gha: + uv run pytest --cov-report=term -r f From 8acf906d70d719b436525610ae4cc6fcbe9874c5 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:21:28 +0100 Subject: [PATCH 03/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index d7f381a..e4807ce 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -13,6 +13,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v5 - name: Test + id: test run: make test-gha >> "$GITHUB_OUTPUT" - uses: actions/github-script@v7 @@ -23,5 +24,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: $GITHUB_OUTPUT + body: {{ steps.test.output }} }) From d847c8a435d7093dd979e22941bb7c6e8be181c8 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:23:09 +0100 Subject: [PATCH 04/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index e4807ce..5610c65 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -14,7 +14,7 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Test id: test - run: make test-gha >> "$GITHUB_OUTPUT" + run: echo "coverage=`make test-gha`" >> "$GITHUB_OUTPUT" - uses: actions/github-script@v7 with: @@ -24,5 +24,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: {{ steps.test.output }} + body: {{ steps.test.output.coverage }} }) From 02b1eb22e06d18cbeb2f3f1a3511714e4f6a4bdb Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:25:01 +0100 Subject: [PATCH 05/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 5610c65..28ff235 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -14,7 +14,7 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Test id: test - run: echo "coverage=`make test-gha`" >> "$GITHUB_OUTPUT" + run: echo "coverage=`make test-gha 2>&1`" >> "$GITHUB_OUTPUT" - uses: actions/github-script@v7 with: From af19942e7e1c0b7e04160ccae3d6ecaa76032421 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:27:19 +0100 Subject: [PATCH 06/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 28ff235..5610c65 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -14,7 +14,7 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Test id: test - run: echo "coverage=`make test-gha 2>&1`" >> "$GITHUB_OUTPUT" + run: echo "coverage=`make test-gha`" >> "$GITHUB_OUTPUT" - uses: actions/github-script@v7 with: From 97b3a34df551760b888da0fb6769ad15ba599b63 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:29:59 +0100 Subject: [PATCH 07/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 5610c65..6d088ba 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -14,7 +14,10 @@ jobs: uses: astral-sh/setup-uv@v5 - name: Test id: test - run: echo "coverage=`make test-gha`" >> "$GITHUB_OUTPUT" + run: | + echo "coverage=<> "$GITHUB_OUTPUT" + make test-gha >> "$GITHUB_OUTPUT" + echo "EOF" >> "$GITHUB_OUTPUT" - uses: actions/github-script@v7 with: From 988ac6f65693cf9d3655bd520a5567a15c16113d Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:30:22 +0100 Subject: [PATCH 08/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 6d088ba..b5f9af3 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -15,7 +15,7 @@ jobs: - name: Test id: test run: | - echo "coverage=<> "$GITHUB_OUTPUT" + echo "coverage=<> "$GITHUB_OUTPUT" make test-gha >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT" From bf6ca73471f8680ec52c24a0953d921a5c04fae8 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:31:19 +0100 Subject: [PATCH 09/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index b5f9af3..e078442 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -15,9 +15,9 @@ jobs: - name: Test id: test run: | - echo "coverage=<> "$GITHUB_OUTPUT" - make test-gha >> "$GITHUB_OUTPUT" - echo "EOF" >> "$GITHUB_OUTPUT" + echo "coverage=<> $GITHUB_OUTPUT + make test-gha >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 with: From 0fe6cb29762cf5a701c6a45300278e750145d680 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:33:21 +0100 Subject: [PATCH 10/25] try publishing code coverage as comment --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 378d2cb..741b1ac 100644 --- a/Makefile +++ b/Makefile @@ -12,4 +12,4 @@ test-report-win: .PHONY: test-gha test-gha: - uv run pytest --cov-report=term -r f + uv run pytest --cov-report=term -r f -s From b69604abe9ad9be9c08f6f70cdecd7a10fbe52e3 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:51:35 +0100 Subject: [PATCH 11/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index e078442..55308f4 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -15,7 +15,7 @@ jobs: - name: Test id: test run: | - echo "coverage=<> $GITHUB_OUTPUT + echo "coverage<> $GITHUB_OUTPUT make test-gha >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT From 3033f2633e9bb415bcdc63ec090388b7d82494be Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:53:12 +0100 Subject: [PATCH 12/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 55308f4..bd6d3f2 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -20,6 +20,8 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 + env: + COVERAGE: {{ steps.test.output.coverage }} with: github-token: ${{secrets.GHA_PRS}} script: | @@ -27,5 +29,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: {{ steps.test.output.coverage }} + body: $COVERAGE }) From 02b2afbca1f9f71cc7fab7a77841cd8d35e08bd8 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 01:55:11 +0100 Subject: [PATCH 13/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index bd6d3f2..e7e7900 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - COVERAGE: {{ steps.test.output.coverage }} + - COVERAGE: {{ steps.test.output.coverage }} with: github-token: ${{secrets.GHA_PRS}} script: | From 44174f626b911d999bdd2f3d4abbbcda6061a174 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:00:55 +0100 Subject: [PATCH 14/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index e7e7900..9c21f8c 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -20,10 +20,9 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 - env: - - COVERAGE: {{ steps.test.output.coverage }} with: github-token: ${{secrets.GHA_PRS}} + COVERAGE: {{ steps.test.output.coverage }} script: | github.rest.issues.createComment({ issue_number: context.issue.number, From 8d9fde530a1bc0678126aa0350ae6756621a2248 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:02:16 +0100 Subject: [PATCH 15/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 9c21f8c..bd6d3f2 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -20,9 +20,10 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 + env: + COVERAGE: {{ steps.test.output.coverage }} with: github-token: ${{secrets.GHA_PRS}} - COVERAGE: {{ steps.test.output.coverage }} script: | github.rest.issues.createComment({ issue_number: context.issue.number, From 911c41067c3a95b05a183dac8cb2205392e87522 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:03:05 +0100 Subject: [PATCH 16/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index bd6d3f2..b27d5c0 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - COVERAGE: {{ steps.test.output.coverage }} + COVERAGE: "{{ steps.test.output.coverage }}" with: github-token: ${{secrets.GHA_PRS}} script: | From 1a1ff73e1248db57a624e633abbba378ad0e1f23 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:05:33 +0100 Subject: [PATCH 17/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index b27d5c0..ed8ac30 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - COVERAGE: "{{ steps.test.output.coverage }}" + INPUT_COVERAGE: "{{ steps.test.output.coverage }}" with: github-token: ${{secrets.GHA_PRS}} script: | @@ -29,5 +29,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: $COVERAGE + body: core.getInput('coverage') }) From 230b004f218442ca28c9164a0de158b1a5bda63b Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:06:35 +0100 Subject: [PATCH 18/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index ed8ac30..1bf9b4c 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - INPUT_COVERAGE: "{{ steps.test.output.coverage }}" + INPUT_COVERAGE: "${{ steps.test.output.coverage }}" with: github-token: ${{secrets.GHA_PRS}} script: | From ba9072d4e5f259725e70b2c43ef90560339a0d9f Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:08:04 +0100 Subject: [PATCH 19/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 1bf9b4c..bd1dee1 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - INPUT_COVERAGE: "${{ steps.test.output.coverage }}" + INPUT_COVERAGE: "${{ steps.test.output }}" with: github-token: ${{secrets.GHA_PRS}} script: | From e6d9a8ec5601b91d0f5e004c5445e0bc7f2046af Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:08:53 +0100 Subject: [PATCH 20/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index bd1dee1..fe0eb00 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - INPUT_COVERAGE: "${{ steps.test.output }}" + INPUT_COVERAGE: ${{ steps.test.output.coverage }} with: github-token: ${{secrets.GHA_PRS}} script: | From 0a70b4bb5f52a6ea57b6947cb81b71e3395a3e5c Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:10:26 +0100 Subject: [PATCH 21/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index fe0eb00..8a88333 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -21,7 +21,7 @@ jobs: - uses: actions/github-script@v7 env: - INPUT_COVERAGE: ${{ steps.test.output.coverage }} + INPUT_COVERAGE: ${{ steps.test.outputs.coverage }} with: github-token: ${{secrets.GHA_PRS}} script: | From 49492a24dedeac358e5c1d1c1c4bceb4c359b7db Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:10:44 +0100 Subject: [PATCH 22/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 8a88333..4eea18e 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -23,7 +23,7 @@ jobs: env: INPUT_COVERAGE: ${{ steps.test.outputs.coverage }} with: - github-token: ${{secrets.GHA_PRS}} + github-token: ${{ secrets.GHA_PRS }} script: | github.rest.issues.createComment({ issue_number: context.issue.number, From 2afa6d381c3014efd098b97c2cea8494101d026a Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:11:51 +0100 Subject: [PATCH 23/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 4eea18e..5313578 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -15,9 +15,9 @@ jobs: - name: Test id: test run: | - echo "coverage<> $GITHUB_OUTPUT + echo "coverage<> $GITHUB_OUTPUT make test-gha >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + echo "```EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 env: From e8c2d27936d39d412370e38122b9b3cfa65a248c Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:12:57 +0100 Subject: [PATCH 24/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 5313578..488fa0c 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -15,9 +15,11 @@ jobs: - name: Test id: test run: | - echo "coverage<> $GITHUB_OUTPUT + echo "coverage<> $GITHUB_OUTPUT + echo "```" >> $GITHUB_OUTPUT make test-gha >> $GITHUB_OUTPUT - echo "```EOF" >> $GITHUB_OUTPUT + echo "```" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 env: From 26f2f37694afea256d150fe4d4dc7de1b6818fd1 Mon Sep 17 00:00:00 2001 From: marcello romani Date: Tue, 26 Aug 2025 02:14:05 +0100 Subject: [PATCH 25/25] try publishing code coverage as comment --- .github/workflows/pr-comment.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pr-comment.yaml b/.github/workflows/pr-comment.yaml index 488fa0c..9b5d7be 100644 --- a/.github/workflows/pr-comment.yaml +++ b/.github/workflows/pr-comment.yaml @@ -16,9 +16,7 @@ jobs: id: test run: | echo "coverage<> $GITHUB_OUTPUT - echo "```" >> $GITHUB_OUTPUT make test-gha >> $GITHUB_OUTPUT - echo "```" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - uses: actions/github-script@v7 @@ -31,5 +29,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: core.getInput('coverage') + body: '```' + core.getInput('coverage') + '```' })