One more change to test shape of benchmarks #24
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: Publish benchmarks to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - update-chipsets | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| env: | |
| # default for the live run; test step will override to local | |
| BENCHMARKS_URL: https://roll20.github.io/detect-gpu | |
| jobs: | |
| build: | |
| name: 🔨 Build & Validate Benchmarks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.x' | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| id: yarn-cache | |
| with: | |
| path: | | |
| node_modules | |
| */*/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| - name: Install dependencies (cold) | |
| if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }} | |
| run: yarn install --frozen-lockfile | |
| - name: Install dependencies (cache hit) | |
| if: ${{ steps.yarn-cache.outputs.cache-hit == 'true' }} | |
| run: yarn install --frozen-lockfile --prefer-offline | |
| - name: Bump patch version | |
| run: npm version patch --no-git-tag-version | |
| - name: Update benchmarks | |
| run: yarn run update-benchmarks | |
| - name: Validate *local* benchmark JSON shape | |
| run: | | |
| npx jest test/validate-benchmarks-shape.test.ts \ | |
| --env=jsdom \ | |
| --runTestsByPath | |
| env: | |
| BENCHMARKS_URL: file://${{ github.workspace }}/benchmarks | |
| - name: Build final result | |
| run: yarn build | |
| - name: Upload benchmarks as Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: benchmarks | |
| deploy: | |
| name: Deploy to GitHub Pages | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |