Skip to content

Commit af27245

Browse files
committed
Add github tokens to download artifacts
* remove rhysd/github-action-benchmark * add benchmark job summary * manually publish codacy coverage
1 parent fe37797 commit af27245

File tree

5 files changed

+19
-26
lines changed

5 files changed

+19
-26
lines changed

.github/workflows/build-status.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ jobs:
8686
id: coverage-paths
8787
run: |
8888
readarray -d '' coveragePathArray < <(find . -name "coverage.cobertura.xml" -print0)
89-
coveragePaths=$(printf ",%s" "${coveragePathArray[@]}")
89+
coveragePaths=$(printf -- "-r %s " "${coveragePathArray[@]}")
9090
echo "COVERAGE_REPORT_PATHS=$coveragePaths" >> $GITHUB_OUTPUT
9191
9292
- name: Publish Code Coverage Results
93-
uses: codacy/codacy-coverage-reporter-action@v1
94-
with:
95-
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
96-
coverage-reports: ${{ steps.coverage-paths.outputs.COVERAGE_REPORT_PATHS }}
93+
run: |
94+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
95+
--project-token ${{ secrets.CODACY_PROJECT_TOKEN }} \
96+
${{ steps.coverage-paths.outputs.COVERAGE_REPORT_PATHS }}
9797
9898
report-benchmark-results:
9999
needs: build-and-test
@@ -107,11 +107,5 @@ jobs:
107107
with:
108108
name: benchmark-results
109109

110-
- name: Report benchmark result
111-
uses: rhysd/github-action-benchmark@v1
112-
with:
113-
name: Benchmark.Net Benchmark
114-
tool: "benchmarkdotnet"
115-
output-file-path: BenchmarkDotNet.Artifacts/results/NHapi.Benchmarks.LargeEmbeddedFileTest-report-full-compressed.json
116-
auto-push: false
117-
summary-always: true
110+
- name: 'Report benchmark result'
111+
run: cat ./NHapi.Benchmarks.LargeEmbeddedFileTest-report-github.md >> $GITHUB_STEP_SUMMARY

.github/workflows/publish-pr-coverage-results.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ jobs:
2424
uses: actions/download-artifact@v4
2525
with:
2626
name: coverage-reports
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
2728
run-id: ${{ github.event.workflow_run.id }}
2829

2930
- name: Set Coverage Report Paths
3031
id: coverage-paths
3132
run: |
3233
readarray -d '' coveragePathArray < <(find . -name "coverage.cobertura.xml" -print0)
33-
coveragePaths=$(printf ",%s" "${coveragePathArray[@]}")
34+
coveragePaths=$(printf -- "-r %s " "${coveragePathArray[@]}")
3435
echo "COVERAGE_REPORT_PATHS=$coveragePaths" >> $GITHUB_OUTPUT
3536
3637
- name: Publish Code Coverage Results
37-
uses: codacy/codacy-coverage-reporter-action@v1
38-
with:
39-
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
40-
coverage-reports: ${{ steps.coverage-paths.outputs.COVERAGE_REPORT_PATHS }}
38+
run: |
39+
bash <(curl -Ls https://coverage.codacy.com/get.sh) report \
40+
--project-token ${{ secrets.CODACY_PROJECT_TOKEN }} \
41+
--commit-uuid ${{ github.event.workflow_run.head_sha }} \
42+
${{ steps.coverage-paths.outputs.COVERAGE_REPORT_PATHS }}

.github/workflows/publish-pr-test-results.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/download-artifact@v4
2222
with:
2323
name: unit-test-results
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
2425
run-id: ${{ github.event.workflow_run.id }}
2526

2627
- name: Publish Unit Test Results

.github/workflows/report-benchmark-results.yml

+3-8
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ jobs:
2020
uses: actions/download-artifact@v4
2121
with:
2222
name: benchmark-results
23+
github-token: ${{ secrets.GITHUB_TOKEN }}
2324
run-id: ${{ github.event.workflow_run.id }}
2425

25-
- name: Report benchmark result
26-
uses: rhysd/github-action-benchmark@v1
27-
with:
28-
name: Benchmark.Net Benchmark
29-
tool: "benchmarkdotnet"
30-
output-file-path: BenchmarkDotNet.Artifacts/results/NHapi.Benchmarks.LargeEmbeddedFileTest-report-full-compressed.json
31-
auto-push: false
32-
summary-always: true
26+
- name: 'Report benchmark result'
27+
run: cat ./NHapi.Benchmarks.LargeEmbeddedFileTest-report-github.md >> $GITHUB_STEP_SUMMARY

tests/NHapi.Benchmarks/LargeEmbeddedFileTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
[MemoryDiagnoser]
1111
[JsonExporterAttribute.FullCompressed]
12+
[MarkdownExporterAttribute.GitHub]
1213
[SimpleJob(RuntimeMoniker.Net462, baseline: true)]
1314
[SimpleJob(RuntimeMoniker.Net60)]
1415
[SimpleJob(RuntimeMoniker.Net80)]

0 commit comments

Comments
 (0)