Skip to content
Merged
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
61 changes: 26 additions & 35 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
pull_request:
workflow_dispatch:

concurrency:
group: verify-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check:
name: Check
Expand All @@ -17,11 +21,18 @@ jobs:
- name: Clone repository
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
run_install: false
version: 10.28.1

- name: Setup Node.js
uses: actions/setup-node@v6

- name: Setup pnpm
run: corepack enable pnpm
with:
node-version: 24.12.0
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install
Expand Down Expand Up @@ -53,6 +64,9 @@ jobs:
e2e:
name: E2E Tests (${{ matrix.shard }}/${{ strategy.job-total }})
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.58.0-noble
options: --user 1001
timeout-minutes: 15
permissions:
contents: read
Expand All @@ -65,45 +79,22 @@ jobs:
- name: Clone repository
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v6

- name: Setup pnpm
run: corepack enable pnpm

- name: Get pnpm store directory
id: pnpm-cache
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT
uses: pnpm/action-setup@v5
with:
run_install: false
version: 10.28.1

- name: Cache pnpm dependencies
uses: actions/cache@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
path: ${{ steps.pnpm-cache.outputs.dir }}
key: pnpm-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-${{ runner.os }}-
node-version: 24.12.0
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install

- name: Get Playwright version
id: playwright-version
run: echo "version=$(pnpm exec playwright --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT

- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}

- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install chromium --with-deps

- name: Install Playwright system deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium

- name: Run Playwright tests
run: pnpm run test:e2e --shard=${{ matrix.shard }}/3

Expand Down
17 changes: 10 additions & 7 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { defineConfig, devices } from '@playwright/test'

const isCI = !!process.env.CI
const webServerUrl = isCI ? 'http://localhost:5173' : 'https://localhost:5173'

export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 1, // Retry once due to testnet flakiness
workers: process.env.CI ? 4 : undefined,
forbidOnly: isCI,
retries: isCI ? 1 : 1, // Retry once due to testnet flakiness
workers: isCI ? 4 : undefined,
timeout: 180000, // 3 min default timeout for testnet transactions
reporter: 'html',
use: {
baseURL: 'https://localhost:5173',
baseURL: webServerUrl,
ignoreHTTPSErrors: true,
trace: 'on-first-retry',
},
Expand All @@ -20,10 +23,10 @@ export default defineConfig({
},
],
webServer: {
command: process.env.CI ? 'VITE_E2E=true pnpm run dev 2>/dev/null' : 'pnpm run dev 2>/dev/null',
url: 'https://localhost:5173',
command: isCI ? 'VITE_E2E=true VITE_USE_HTTP=true pnpm run dev' : 'pnpm run dev 2>/dev/null',
url: webServerUrl,
ignoreHTTPSErrors: true,
reuseExistingServer: !process.env.CI,
reuseExistingServer: !isCI,
stdout: 'ignore',
stderr: 'ignore',
},
Expand Down
10 changes: 9 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@ export default defineConfig(({ mode }) => {
for (const key of Object.keys(env)) {
if (!(key in process.env)) process.env[key] = env[key]
}

const useHttp = process.env.CI === 'true' || process.env.VITE_USE_HTTP === 'true'

return {
plugins: [syncTips(), vocs(), react(), mkcert(), tempoNode()],
plugins: [syncTips(), vocs(), react(), ...(useHttp ? [] : [mkcert()]), tempoNode()],
server: useHttp
? {
host: 'localhost',
}
: undefined,
}
})

Expand Down
Loading