Skip to content

.github/workflows/preview.yaml #1613

.github/workflows/preview.yaml

.github/workflows/preview.yaml #1613

Workflow file for this run

on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches: [main]
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
environment: Preview
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: exactly
SENTRY_PROJECT: webapp
SENTRY_ENVIRONMENT: development
NEXT_PUBLIC_NETWORK: 11155420
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
- run: bun install
- run: bun run check
e2e:
needs: [check]
if: ${{ !github.event.pull_request.draft }}
timeout-minutes: 30
runs-on: ubuntu-latest
environment: Test
env:
NEXT_PUBLIC_SOCKET_API_KEY: ${{ secrets.NEXT_PUBLIC_SOCKET_API_KEY }}
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}
TENDERLY_PROJECT: exactly
TENDERLY_USER: exactly
NODE_OPTIONS: '--max_old_space_size=4096'
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-
- run: bun install
- run: bun run build:e2e
- run: bun playwright install chromium --with-deps
- run: bun playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: blob-report-${{ matrix.shardIndex }}
path: blob-report
retention-days: 1
e2e-report:
needs: [e2e]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: oven-sh/setup-bun@v1
- run: bun install
- uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- run: bun playwright merge-reports --reporter html ./all-blob-reports
- uses: actions/upload-artifact@v4
with:
name: html-report
path: playwright-report
retention-days: 30
e2e-report-publish:
needs: [e2e-report]
if: ${{ always() && needs.e2e-report.result == 'success' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: html-report
path: html-report
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 569f3c4008862b4cc595f409db748f41
projectName: app-test
directory: html-report