Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: E2E Tests

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
e2e:
name: E2E Tests
timeout-minutes: 60
runs-on: ubuntu-latest

defaults:
run:
working-directory: ./soroscan-frontend

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Build application
run: pnpm run build
env:
NEXT_PUBLIC_GRAPHQL_ENDPOINT: http://localhost:8000/graphql

- name: Run Playwright tests
run: pnpm exec playwright test
env:
CI: true
BASE_URL: http://localhost:3000

- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: soroscan-frontend/playwright-report/
retention-days: 30

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-results
path: soroscan-frontend/test-results/
retention-days: 30

e2e-cross-browser:
name: E2E Tests (Cross-Browser)
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'

strategy:
fail-fast: false
matrix:
browser: [chromium, firefox, webkit]

defaults:
run:
working-directory: ./soroscan-frontend

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps ${{ matrix.browser }}

- name: Build application
run: pnpm run build
env:
NEXT_PUBLIC_GRAPHQL_ENDPOINT: http://localhost:8000/graphql

- name: Run Playwright tests on ${{ matrix.browser }}
run: pnpm exec playwright test --project=${{ matrix.browser }}
env:
CI: true
BASE_URL: http://localhost:3000

- name: Upload Playwright Report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.browser }}
path: soroscan-frontend/playwright-report/
retention-days: 30
21 changes: 10 additions & 11 deletions soroscan-frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
.pnp.js
.yarn/install-state.gz

# testing
/coverage
/test-results
/playwright-report
/playwright/.cache

# next.js
/.next/
Expand All @@ -28,10 +27,10 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*
# local env files
.env*.local
.env

# vercel
.vercel
Expand All @@ -40,5 +39,5 @@ yarn-error.log*
*.tsbuildinfo
next-env.d.ts

# graphql codegen
/src/generated/
# GraphQL generated files
/src/gql/
Loading
Loading