This repository was archived by the owner on Jun 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
141 lines (120 loc) · 4.61 KB
/
Copy pathdeploy-dashboard.yml
File metadata and controls
141 lines (120 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Deploy Dashboard
on:
schedule:
- cron: '0 8,20 * * *'
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
actions: read
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: 'recursive'
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
- name: Download latest picofuzz artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p artifacts
TARGETS=$(ls -d teams/*/ 2>/dev/null | xargs -n1 basename | tr '\n' ' ')
BENCHMARKS="fallback safrole storage storage_light"
for target in $TARGETS; do
for bench in $BENCHMARKS; do
ARTIFACT="picofuzz-csv-${target}-${bench}"
echo "Downloading ${ARTIFACT}..."
SUCCESS=false
for attempt in 1 2 3; do
if gh run download --repo "${{ github.repository }}" \
--name "$ARTIFACT" \
--dir "artifacts/${ARTIFACT}" 2>/dev/null; then
SUCCESS=true
break
fi
echo " attempt $attempt failed, retrying in ${attempt}s..."
sleep "$attempt"
done
if [ "$SUCCESS" = false ]; then
echo " (not found after 3 attempts, skipping)"
fi
done
done
echo "Downloaded artifacts:"
find artifacts -name '*.csv' | sort
- name: Convert CSV to dashboard JSON
run: |
node scripts/csv-to-dashboard-json.cjs artifacts fuzz-perf
- name: Install dashboard dependencies
working-directory: dashboard
run: npm ci
- name: Generate dashboard data
working-directory: dashboard
run: npm run update-all-data
- name: Fetch existing history from Pages
run: |
REPO_NAME="${{ github.event.repository.name }}"
PAGES_URL="https://${{ github.repository_owner }}.github.io/${REPO_NAME}/data/history.json"
echo "Fetching history from ${PAGES_URL}..."
curl -sfL "${PAGES_URL}" -o existing-history.json 2>/dev/null || echo '[]' > existing-history.json
echo "Existing history entries: $(cat existing-history.json | node -e 'let d="";process.stdin.on("data",c=>d+=c);process.stdin.on("end",()=>{try{console.log(JSON.parse(d).length)}catch{console.log(0)}})')"
- name: Append current data to history
run: |
node scripts/update-history.cjs \
existing-history.json \
dashboard/src/data/aggregated-data.json \
dashboard/public/data/history.json \
"${{ github.sha }}"
- name: Copy current data files for download
run: |
cp dashboard/src/data/aggregated-data.json dashboard/public/data/aggregated-data.json
cp dashboard/src/data/all-benchmarks-data.json dashboard/public/data/all-benchmarks-data.json
- name: Patch dashboard with download link
run: node scripts/patch-dashboard-download-link.cjs
- name: Write source info
working-directory: dashboard
run: |
node -e "
const fs = require('fs');
fs.writeFileSync('src/data/source-info.json', JSON.stringify({
lastUpdated: new Date().toISOString(),
source: {
commitHash: '${{ github.sha }}',
commitDate: new Date().toISOString(),
commitMessage: 'Picofuzz results from jam-testing',
commitAuthor: 'GitHub Actions',
sourceUrl: 'https://github.com/${{ github.repository }}/commit/${{ github.sha }}'
}
}, null, 2));
"
- name: Patch basePath for this repo
working-directory: dashboard
run: |
REPO_NAME="${{ github.event.repository.name }}"
sed -i "s|/jam-conformance-dashboard|/${REPO_NAME}|g" next.config.ts
sed -i "s|/jam-conformance-dashboard|/${REPO_NAME}|g" src/config/app.ts
- name: Build dashboard
working-directory: dashboard
env:
NODE_ENV: production
run: npm run build
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: dashboard/out
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5