Vercel Integration Tests #1099
This file contains 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: Vercel Integration Tests | |
on: | |
deployment_status: | |
jobs: | |
log: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Log the deployment status | |
run: echo 'Deployment status is ${{ toJSON(github.event.deployment_status) }}' | |
run-next-e2e: | |
if: | | |
github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && ( | |
github.event.deployment_status.environment == 'Preview – apollo__experimental-nextjs-app-support' || | |
github.event.deployment_status.environment == 'Preview – apollo__client-integration-tanstack-start' | |
) | |
runs-on: ubuntu-latest | |
name: Run Playwright tests against Vercel deployment ${{ github.event.deployment_status.environment }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "yarn" | |
- name: Install Packages (Root) | |
run: yarn install --immutable --mode=skip-build | |
- run: yarn build:libs | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: yarn why @playwright/test --json | jq '.children|to_entries[0].value.locator' --raw-output | sed 's/^.*npm:/PLAYWRIGHT_VERSION=/' >> $GITHUB_ENV | |
- name: Cache playwright binaries | |
uses: actions/cache@v4 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: "Run Playwright tests against Vercel deployment - Next.js" | |
if: github.event.deployment_status.environment == 'Preview – apollo__experimental-nextjs-app-support' | |
run: yarn workspace @integration-test/nextjs run test | tee $GITHUB_STEP_SUMMARY; exit ${PIPESTATUS[0]} | |
env: | |
BASE_URL: ${{ github.event.deployment_status.environment_url }} | |
- name: "Run Playwright tests against Vercel deployment - TanStack Start" | |
if: github.event.deployment_status.environment == 'Preview – apollo__client-integration-tanstack-start' | |
run: yarn workspace @integration-test/tanstack-start run test | tee $GITHUB_STEP_SUMMARY; exit ${PIPESTATUS[0]} | |
env: | |
BASE_URL: ${{ github.event.deployment_status.environment_url }} | |
- name: "Run Playwright tests against Vercel deployment - React Router" | |
if: github.event.deployment_status.environment == 'Preview – apoll__client-integration-react-router' | |
run: yarn workspace @integration-test/react-router run test | tee $GITHUB_STEP_SUMMARY; exit ${PIPESTATUS[0]} | |
env: | |
BASE_URL: ${{ github.event.deployment_status.environment_url }} |