Skip to content

Commit d2ba40b

Browse files
committed
dashboard: Add view for PR runs
Added a script that fetches PR data and created a separate view on the dashboard. Fixes kata-containers#1 Signed-off-by: Anna Finn <[email protected]>
1 parent ff45e30 commit d2ba40b

File tree

6 files changed

+1010
-332
lines changed

6 files changed

+1010
-332
lines changed

.github/workflows/fectch-ci-data.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Fetch CI Data
2+
run-name: Fetch CI Data
3+
on:
4+
schedule:
5+
- cron: '0 */2 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
fetch-and-commit-data:
10+
runs-on: ubuntu-22.04
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Update dashboard data
16+
run: |
17+
# fetch ci nightly data as temporary file
18+
TOKEN=${{ secrets.GITHUB_TOKEN }} node scripts/fetch-ci-nightly-data.js | tee tmp-data.json
19+
TOKEN=${{ secrets.GITHUB_TOKEN }} node scripts/fetch-ci-pr-data.js | tee tmp-data2.json
20+
21+
# switch to a branch specifically for holding latest data
22+
git config --global user.name "GH Actions Workflow"
23+
git config --global user.email "<gha@runner>"
24+
git fetch --all
25+
git checkout latest-dashboard-data
26+
27+
# back out whatever data was there
28+
git reset HEAD~1
29+
30+
# overwrite the old data
31+
mkdir -p data/
32+
mv tmp-data.json data/job_stats.json
33+
mv tmp-data2.json data/check_stats.json
34+
35+
# commit
36+
git add data
37+
git commit -m '[skip ci] latest ci nightly data'
38+
git push --force

0 commit comments

Comments
 (0)