Repository navigation
chore: improve contributor onboarding and UI safeguards #531
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci --legacy-peer-deps | |
| - run: npm test | |
| - run: npm run build | |
| e2e: | |
| name: Playwright E2E | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - run: npm ci --legacy-peer-deps | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium firefox webkit | |
| - name: Build app in mock mode | |
| run: npm run build | |
| env: | |
| NEXT_PUBLIC_STREAM_CONTRACT_ID_TESTNET: '' | |
| NEXT_PUBLIC_STREAM_CONTRACT_ID_MAINNET: '' | |
| - name: Run Playwright tests | |
| # --update-snapshots generates missing baselines on first run so the | |
| # job does not fail when new visual tests are added without pre-committed | |
| # PNG baselines. On subsequent runs the existing PNGs are used as-is. | |
| run: npx playwright test --update-snapshots | |
| env: | |
| NEXT_PUBLIC_STREAM_CONTRACT_ID_TESTNET: '' | |
| NEXT_PUBLIC_STREAM_CONTRACT_ID_MAINNET: '' | |
| - name: Commit generated snapshots | |
| # If new baseline PNGs were written, commit and push them so the next | |
| # CI run can diff against them. Only runs when there are staged changes. | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add e2e/__screenshots__/ | |
| git diff --cached --quiet || git commit -m "test: update playwright visual snapshots [skip ci]" && git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Playwright report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |