This repository was archived by the owner on Jun 7, 2026. It is now read-only.
Deploy Dashboard #271
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |