From 4212fe8622d99d98ffa7ba798c3039f5ec38d3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 6 Jun 2023 15:20:22 +0200 Subject: [PATCH 1/3] #972: auto-formatting --- .coverage-comment-template.svelte | 338 ++++++++++++++++-------------- 1 file changed, 177 insertions(+), 161 deletions(-) diff --git a/.coverage-comment-template.svelte b/.coverage-comment-template.svelte index 8455cd02f..ae2267b27 100644 --- a/.coverage-comment-template.svelte +++ b/.coverage-comment-template.svelte @@ -1,178 +1,194 @@

Coverage Report

-Commit: {short_commit_sha}
-Base: {base_ref}@{base_short_commit_sha}

+Commit:{short_commit_sha}
+Base: {base_ref}@{base_short_commit_sha}

- - - {#if has_base_data} - - {/if} - - - - {#each summary_list as {type, percent}} - - + + {#if has_base_data} - + {/if} - - - {/each} - -
TypeBaseThis PR
{type}
Type - {#if Number.isFinite(percent.base)} -  {percent.base}% - {:else} - - - {/if} - Base - {#if Number.isFinite(percent.total)} -  {percent.total}% - {#if has_base_data} -  ({formatPercentDiff(percent.diff)}) - {/if} - {:else} - - - {/if} -
- -
- Details (changed testable files):
- - - - - - - + - {#each changed_files_coverage_data as [file, data]} - {@const percents = [ - data.statements.pct, - data.branches.pct, - data.functions.pct, - data.lines.pct - ]} - - - {#each percents as percent} - - {/each} - - {/each} + {#each summary_list as { type, percent }} + + + {#if has_base_data} + + {/if} + + + {/each} -
FileStatementsBranchesFunctionsLinesThis PR
- {file} - - {#if Number.isFinite(percent)} -  {percent}% - {:else} - - - {/if} -
{type} + {#if Number.isFinite(percent.base)} +  {percent.base}% + {:else} + - + {/if} + + {#if Number.isFinite(percent.total)} +  {percent.total}% + {#if has_base_data} +  ({formatPercentDiff(percent.diff)}) + {/if} + {:else} + - + {/if} +
-
\ No newline at end of file + + +
+ Details (changed files):
+ + + + + + + + + + {#each changed_files_coverage_data as [file, data]} + {@const percents = [ + data.statements.pct, + data.branches.pct, + data.functions.pct, + data.lines.pct, + ]} + + + {#each percents as percent} + + {/each} + + {/each} + +
FileStatementsBranchesFunctionsLines
+ {file} + + {#if Number.isFinite(percent)} +  {percent}% + {:else} + - + {/if} +
+
From 96a6abda5b77e5514dd8f42279e266d04426a4d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 6 Jun 2023 15:22:37 +0200 Subject: [PATCH 2/3] #972: bump sidx1024/report-nyc-coverage-github-action from 1.2.6 to 1.2.7 --- .coverage-comment-template.md | 20 ------------------- .github/workflows/coverage-base-update.yml | 4 ++-- .github/workflows/coverage-develop-branch.yml | 9 +++------ .github/workflows/coverage-main-branch.yml | 9 +++------ .github/workflows/coverage.yml | 4 ++-- 5 files changed, 10 insertions(+), 36 deletions(-) delete mode 100644 .coverage-comment-template.md diff --git a/.coverage-comment-template.md b/.coverage-comment-template.md deleted file mode 100644 index 4aceff38b..000000000 --- a/.coverage-comment-template.md +++ /dev/null @@ -1,20 +0,0 @@ -## Coverage Report - -Commit: [{{short_commit_sha}}]({{commit_link}}) -Base: [{{base_ref}}@{{base_short_commit_sha}}]({{base_commit_link}}) - -| Type | Base | This PR | -| ------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------- | -| Total Statements Coverage | {{base_total_statements_coverage_percent}} | {{total_statements_coverage_percent}} ({{total_statements_coverage_percent_diff}}) | -| Total Branches Coverage | {{base_total_branches_coverage_percent}} | {{total_branches_coverage_percent}} ({{total_branches_coverage_percent_diff}}) | -| Total Functions Coverage | {{base_total_functions_coverage_percent}} | {{total_functions_coverage_percent}} ({{total_functions_coverage_percent_diff}}) | -| Total Lines Coverage | {{base_total_lines_coverage_percent}} | {{total_lines_coverage_percent}} ({{total_lines_coverage_percent_diff}}) | - -
-Details (changed files) -{{changed_files_coverage_table}} -
-
-Details (all files) -{{files_coverage_table}} -
diff --git a/.github/workflows/coverage-base-update.yml b/.github/workflows/coverage-base-update.yml index 87dd0f1b4..d06787a62 100644 --- a/.github/workflows/coverage-base-update.yml +++ b/.github/workflows/coverage-base-update.yml @@ -1,4 +1,4 @@ -name: Update coverage comment +name: Update coverage comment (base-update.yml) on: pull_request: types: [edited] @@ -48,7 +48,7 @@ jobs: files: 'base-artifacts/coverage-summary.json, artifacts/coverage-summary.json' - name: Update Coverage comment - uses: sidx1024/report-nyc-coverage-github-action@v1.2.6 + uses: sidx1024/report-nyc-coverage-github-action@v1.2.7 if: steps.check_files.outputs.files_exists == 'true' # Only runs if all of the files exists with: diff --git a/.github/workflows/coverage-develop-branch.yml b/.github/workflows/coverage-develop-branch.yml index 9ace0197d..32ca5cfb2 100644 --- a/.github/workflows/coverage-develop-branch.yml +++ b/.github/workflows/coverage-develop-branch.yml @@ -1,4 +1,4 @@ -name: Test coverage for develop branch +name: Test coverage for develop branch (default-branch.yml) on: push: @@ -8,17 +8,14 @@ on: jobs: hello_world_job: runs-on: ubuntu-latest - name: Test and report + name: Test and upload coverage steps: - name: Checkout uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.ref }} fetch-depth: 1000 - - name: Fetch base - run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000 - - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/.github/workflows/coverage-main-branch.yml b/.github/workflows/coverage-main-branch.yml index ce40479d9..3cda0748d 100644 --- a/.github/workflows/coverage-main-branch.yml +++ b/.github/workflows/coverage-main-branch.yml @@ -1,4 +1,4 @@ -name: Test coverage for main branch +name: Test coverage for main branch (default-branch.yml) on: push: @@ -8,17 +8,14 @@ on: jobs: hello_world_job: runs-on: ubuntu-latest - name: Test and report + name: Test and upload coverage steps: - name: Checkout uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.ref }} fetch-depth: 1000 - - name: Fetch base - run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000 - - uses: actions/setup-node@v3 with: node-version: 16 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 9ea664a6b..fc9738035 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,6 @@ on: [pull_request] -name: Test coverage report +name: Test coverage report (main.yml) jobs: hello_world_job: runs-on: ubuntu-latest @@ -69,7 +69,7 @@ jobs: files: 'base-artifacts/coverage-summary.json' - name: Report coverage - uses: sidx1024/report-nyc-coverage-github-action@v1.2.6 + uses: sidx1024/report-nyc-coverage-github-action@v1.2.7 id: report with: coverage_file: 'artifacts/test-coverage-output/coverage-summary.json' From 6a93f524ef904431223e197581a8d7eb8603cb58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 6 Jun 2023 15:30:32 +0200 Subject: [PATCH 3/3] #972: turn original file names into comments --- .github/workflows/coverage-base-update.yml | 2 +- .github/workflows/coverage-develop-branch.yml | 2 +- .github/workflows/coverage-main-branch.yml | 2 +- .github/workflows/coverage.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage-base-update.yml b/.github/workflows/coverage-base-update.yml index d06787a62..1622e80ae 100644 --- a/.github/workflows/coverage-base-update.yml +++ b/.github/workflows/coverage-base-update.yml @@ -1,4 +1,4 @@ -name: Update coverage comment (base-update.yml) +name: Update coverage comment # base-update.yml on: pull_request: types: [edited] diff --git a/.github/workflows/coverage-develop-branch.yml b/.github/workflows/coverage-develop-branch.yml index 32ca5cfb2..25ab01d2a 100644 --- a/.github/workflows/coverage-develop-branch.yml +++ b/.github/workflows/coverage-develop-branch.yml @@ -1,4 +1,4 @@ -name: Test coverage for develop branch (default-branch.yml) +name: Test coverage for develop branch # default-branch.yml on: push: diff --git a/.github/workflows/coverage-main-branch.yml b/.github/workflows/coverage-main-branch.yml index 3cda0748d..d0a89d4b3 100644 --- a/.github/workflows/coverage-main-branch.yml +++ b/.github/workflows/coverage-main-branch.yml @@ -1,4 +1,4 @@ -name: Test coverage for main branch (default-branch.yml) +name: Test coverage for main branch # default-branch.yml on: push: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fc9738035..4ab8a75bc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,6 +1,6 @@ on: [pull_request] -name: Test coverage report (main.yml) +name: Test coverage report # main.yml jobs: hello_world_job: runs-on: ubuntu-latest