| 1 | name: E2E - Generate Timings |
| 2 | |
| 3 | on: |
| 4 | # run this workflow every night at 3am |
| 5 | schedule: |
| 6 | - cron: '28 3 * * *' |
| 7 | # or when the user triggers it from GitHub Actions page |
| 8 | workflow_dispatch: |
| 9 | |
| 10 | concurrency: ${{ github.workflow }}-${{ github.ref }} |
| 11 | |
| 12 | permissions: |
| 13 | contents: write |
| 14 | pull-requests: write |
| 15 | |
| 16 | jobs: |
| 17 | timings: |
| 18 | runs-on: ubuntu-latest |
| 19 | container: |
| 20 | image: cypress/browsers:node-20.16.0-chrome-127.0.6533.88-1-ff-128.0.3-edge-127.0.2651.74-1 |
| 21 | options: --user 1001 |
| 22 | steps: |
| 23 | - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 24 | - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 |
| 25 | - name: Setup Node.js |
| 26 | uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 |
| 27 | with: |
| 28 | node-version-file: '.node-version' |
| 29 | - name: Install dependencies |
| 30 | uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 |
| 31 | with: |
| 32 | runTests: false |
| 33 | |
| 34 | - name: Cypress run |
| 35 | uses: cypress-io/github-action@108b8684ae52e735ff7891524cbffbcd4be5b19f # v6.7.16 |
| 36 | id: cypress |
| 37 | with: |
| 38 | install: false |
| 39 | start: pnpm run dev:coverage |
| 40 | wait-on: 'http://localhost:9000' |
| 41 | browser: chrome |
| 42 | publish-summary: false |
| 43 | env: |
| 44 | VITEST_COVERAGE: true |
| 45 | CYPRESS_COMMIT: ${{ github.sha }} |
| 46 | SPLIT: 1 |
| 47 | SPLIT_INDEX: 0 |
| 48 | SPLIT_FILE: 'cypress/timings.json' |
| 49 | |
| 50 | - name: Compare timings |
| 51 | id: compare |
| 52 | run: | |
| 53 | OUTPUT=$(pnpm tsx scripts/compare-timings.ts) |
| 54 | echo "$OUTPUT" >> $GITHUB_STEP_SUMMARY |
| 55 | |
| 56 | echo "output<<EOF" >> $GITHUB_OUTPUT |
| 57 | echo "$OUTPUT" >> $GITHUB_OUTPUT |
| 58 | echo "EOF" >> $GITHUB_OUTPUT |
| 59 | |
| 60 | - name: Commit and create pull request |
| 61 | uses: peter-evans/create-pull-request@2271f1ddcf09437ed8f019733eb5cfba58ac76f0 |
| 62 | with: |
| 63 | add-paths: | |
| 64 | cypress/timings.json |
| 65 | commit-message: 'chore: update E2E timings' |
| 66 | branch: update-timings |
| 67 | title: Update E2E Timings |
| 68 | body: ${{ steps.compare.outputs.output }} |
| 69 | delete-branch: true |
| 70 | sign-commits: true |
| 71 | |