Skip to content

Commit 2e16060

Browse files
committed
Add GitHub Pages dashboard publishing to CI workflows
Each workflow now publishes its metrics as JSON to the gh-pages branch after successful runs on master. Coverage workflows also publish full JaCoCo HTML reports for per-package/per-file browsing. ReadMe links to the dashboard at https://aavso.github.io/VStar/. Made-with: Cursor
1 parent 43af0a0 commit 2e16060

File tree

6 files changed

+202
-1
lines changed

6 files changed

+202
-1
lines changed

.github/workflows/checkerframework.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches: [ master ]
88

99
permissions:
10+
contents: write
1011
pull-requests: write
1112

1213
jobs:
@@ -124,3 +125,38 @@ jobs:
124125
with:
125126
name: checker-framework-report
126127
path: test_report/checkerframework/checker-report.txt
128+
129+
- name: Checkout gh-pages
130+
if: >-
131+
github.event_name == 'push' &&
132+
github.ref == 'refs/heads/master' &&
133+
steps.cf-warnings.outputs.found == 'true'
134+
uses: actions/checkout@v4
135+
with:
136+
ref: gh-pages
137+
path: _site
138+
139+
- name: Publish to dashboard
140+
if: >-
141+
github.event_name == 'push' &&
142+
github.ref == 'refs/heads/master' &&
143+
steps.cf-warnings.outputs.found == 'true'
144+
run: |
145+
DATE=$(date -u +%Y-%m-%d)
146+
cat > _site/data/checker.json <<DATAJSON
147+
{
148+
"updated": "${DATE}",
149+
"total": ${{ steps.cf-warnings.outputs.total }},
150+
"nullness": ${{ steps.cf-warnings.outputs.nullness }},
151+
"init": ${{ steps.cf-warnings.outputs.init }}
152+
}
153+
DATAJSON
154+
155+
cd _site
156+
git config user.email "github-actions[bot]@users.noreply.github.com"
157+
git config user.name "github-actions[bot]"
158+
git add -A
159+
git diff --cached --quiet && exit 0
160+
git commit -m "Update Checker Framework data [${DATE}]"
161+
git pull --rebase origin gh-pages || true
162+
git push origin gh-pages

.github/workflows/pit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
workflow_dispatch:
77

88
permissions:
9+
contents: write
910
issues: write
1011

1112
jobs:
@@ -171,3 +172,34 @@ jobs:
171172
state_reason: 'completed',
172173
});
173174
}
175+
176+
- name: Checkout gh-pages
177+
if: always() && steps.pit-score.outputs.score != 'N/A'
178+
uses: actions/checkout@v4
179+
with:
180+
ref: gh-pages
181+
path: _site
182+
183+
- name: Publish to dashboard
184+
if: always() && steps.pit-score.outputs.score != 'N/A'
185+
run: |
186+
DATE=$(date -u +%Y-%m-%d)
187+
cat > _site/data/pit.json <<DATAJSON
188+
{
189+
"updated": "${DATE}",
190+
"score": "${{ steps.pit-score.outputs.score }}",
191+
"total": ${{ steps.pit-score.outputs.total }},
192+
"killed": ${{ steps.pit-score.outputs.killed }},
193+
"survived": ${{ steps.pit-score.outputs.survived }},
194+
"no_coverage": ${{ steps.pit-score.outputs.no_coverage }}
195+
}
196+
DATAJSON
197+
198+
cd _site
199+
git config user.email "github-actions[bot]@users.noreply.github.com"
200+
git config user.name "github-actions[bot]"
201+
git add -A
202+
git diff --cached --quiet && exit 0
203+
git commit -m "Update PIT mutation data [${DATE}]"
204+
git pull --rebase origin gh-pages || true
205+
git push origin gh-pages

.github/workflows/plugin-UT.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
branches: [ master ]
1212

1313
permissions:
14+
contents: write
1415
pull-requests: write
1516

1617
jobs:
@@ -181,3 +182,49 @@ jobs:
181182
with:
182183
name: plugin-coverage-report-java${{ matrix.java }}
183184
path: plugin/test_report/
185+
186+
- name: Checkout gh-pages
187+
if: >-
188+
github.event_name == 'push' &&
189+
github.ref == 'refs/heads/master' &&
190+
matrix.java == '17' &&
191+
steps.metrics.outputs.tests != '0'
192+
uses: actions/checkout@v4
193+
with:
194+
ref: gh-pages
195+
path: _site
196+
197+
- name: Publish to dashboard
198+
if: >-
199+
github.event_name == 'push' &&
200+
github.ref == 'refs/heads/master' &&
201+
matrix.java == '17' &&
202+
steps.metrics.outputs.tests != '0'
203+
run: |
204+
DATE=$(date -u +%Y-%m-%d)
205+
cat > _site/data/plugin-coverage.json <<DATAJSON
206+
{
207+
"updated": "${DATE}",
208+
"java_version": "17",
209+
"tests": ${{ steps.metrics.outputs.tests }},
210+
"passed": ${{ steps.metrics.outputs.passed }},
211+
"failures": ${{ steps.metrics.outputs.failures }},
212+
"errors": ${{ steps.metrics.outputs.errors }},
213+
"line_coverage": "${{ steps.metrics.outputs.line_cov }}",
214+
"branch_coverage": "${{ steps.metrics.outputs.branch_cov }}"
215+
}
216+
DATAJSON
217+
218+
rm -rf _site/coverage/plugins/*
219+
if [ -d "plugin/test_report/coverage" ]; then
220+
cp -r plugin/test_report/coverage/* _site/coverage/plugins/
221+
fi
222+
223+
cd _site
224+
git config user.email "github-actions[bot]@users.noreply.github.com"
225+
git config user.name "github-actions[bot]"
226+
git add -A
227+
git diff --cached --quiet && exit 0
228+
git commit -m "Update plugin coverage data [${DATE}]"
229+
git pull --rebase origin gh-pages || true
230+
git push origin gh-pages

.github/workflows/spotbugs.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99

1010
permissions:
1111
checks: write
12-
contents: read
12+
contents: write
1313
pull-requests: write
1414

1515
jobs:
@@ -135,3 +135,39 @@ jobs:
135135
with:
136136
path: '**/spotbugsXml.xml'
137137
fail-on-violation: false
138+
139+
- name: Checkout gh-pages
140+
if: >-
141+
github.event_name == 'push' &&
142+
github.ref == 'refs/heads/master' &&
143+
steps.sb-counts.outputs.found == 'true'
144+
uses: actions/checkout@v4
145+
with:
146+
ref: gh-pages
147+
path: _site
148+
149+
- name: Publish to dashboard
150+
if: >-
151+
github.event_name == 'push' &&
152+
github.ref == 'refs/heads/master' &&
153+
steps.sb-counts.outputs.found == 'true'
154+
run: |
155+
DATE=$(date -u +%Y-%m-%d)
156+
cat > _site/data/spotbugs.json <<DATAJSON
157+
{
158+
"updated": "${DATE}",
159+
"total": ${{ steps.sb-counts.outputs.total }},
160+
"high": ${{ steps.sb-counts.outputs.high }},
161+
"medium": ${{ steps.sb-counts.outputs.medium }},
162+
"low": ${{ steps.sb-counts.outputs.low }}
163+
}
164+
DATAJSON
165+
166+
cd _site
167+
git config user.email "github-actions[bot]@users.noreply.github.com"
168+
git config user.name "github-actions[bot]"
169+
git add -A
170+
git diff --cached --quiet && exit 0
171+
git commit -m "Update SpotBugs data [${DATE}]"
172+
git pull --rebase origin gh-pages || true
173+
git push origin gh-pages

.github/workflows/vstar-UT.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
branches: [ master ]
1212

1313
permissions:
14+
contents: write
1415
pull-requests: write
1516

1617
jobs:
@@ -178,3 +179,49 @@ jobs:
178179
with:
179180
name: coverage-report-java${{ matrix.java }}
180181
path: test_report/coverage/
182+
183+
- name: Checkout gh-pages
184+
if: >-
185+
github.event_name == 'push' &&
186+
github.ref == 'refs/heads/master' &&
187+
matrix.java == '17' &&
188+
steps.metrics.outputs.tests != '0'
189+
uses: actions/checkout@v4
190+
with:
191+
ref: gh-pages
192+
path: _site
193+
194+
- name: Publish to dashboard
195+
if: >-
196+
github.event_name == 'push' &&
197+
github.ref == 'refs/heads/master' &&
198+
matrix.java == '17' &&
199+
steps.metrics.outputs.tests != '0'
200+
run: |
201+
DATE=$(date -u +%Y-%m-%d)
202+
cat > _site/data/coverage.json <<DATAJSON
203+
{
204+
"updated": "${DATE}",
205+
"java_version": "17",
206+
"tests": ${{ steps.metrics.outputs.tests }},
207+
"passed": ${{ steps.metrics.outputs.passed }},
208+
"failures": ${{ steps.metrics.outputs.failures }},
209+
"errors": ${{ steps.metrics.outputs.errors }},
210+
"line_coverage": "${{ steps.metrics.outputs.line_cov }}",
211+
"branch_coverage": "${{ steps.metrics.outputs.branch_cov }}"
212+
}
213+
DATAJSON
214+
215+
rm -rf _site/coverage/vstar/*
216+
if [ -d "test_report/coverage" ]; then
217+
cp -r test_report/coverage/* _site/coverage/vstar/
218+
fi
219+
220+
cd _site
221+
git config user.email "github-actions[bot]@users.noreply.github.com"
222+
git config user.name "github-actions[bot]"
223+
git add -A
224+
git diff --cached --quiet && exit 0
225+
git commit -m "Update VStar coverage data [${DATE}]"
226+
git pull --rebase origin gh-pages || true
227+
git push origin gh-pages

ReadMe.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
[![PIT Mutation Testing](https://github.com/AAVSO/VStar/actions/workflows/pit.yml/badge.svg)](https://github.com/AAVSO/VStar/actions/workflows/pit.yml)
77
[![Checker Framework](https://github.com/AAVSO/VStar/actions/workflows/checkerframework.yml/badge.svg)](https://github.com/AAVSO/VStar/actions/workflows/checkerframework.yml)
88
[![ascl:1407.013](https://img.shields.io/badge/ascl-1407.013-blue.svg?colorB=262256)](https://ascl.net/1407.013)
9+
10+
**[Project Health Dashboard](https://aavso.github.io/VStar/)** &mdash; coverage reports, static analysis, mutation testing
11+
912
## VStar
1013

1114
### Introduction

0 commit comments

Comments
 (0)