Skip to content

Commit

Permalink
chore: run Playwright on self-hosted runners (#2788)
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Sep 3, 2024
1 parent 13cb0ff commit 7f3b8c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 15 deletions.
41 changes: 27 additions & 14 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,31 @@ on:
required: false

jobs:
setup_playwright_runners:
uses: WalletConnect/gh-actions-runners/.github/workflows/setup-runners.yml@main
with:
cpu: 16384
memory: 65536
labels: playwright
count: 5
secrets:
GITHUB_PAT: ${{ secrets.RELEASE_TOKEN }}
TF_API_TOKEN: ${{ secrets.TFC_INFRA_TOKEN }}

ui_tests:
name: 'Playwright Tests'
runs-on:
group: ubuntu-runners
runs-on: [self-hosted, playwright]
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
shardTotal: [5]
timeout-minutes: 20
steps:
- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1
# Possibly this helps with GitHub-hosted runner network issues, but it's not confirmed
# It's not supported in self-hosted runners, however, so commenting it out for now
# - name: Tune GitHub-hosted runner network
# uses: smorimoto/tune-github-hosted-runner-network@v1

- name: checkout
uses: actions/checkout@v4
Expand All @@ -75,17 +87,18 @@ jobs:
node-version: 18.x
cache: 'pnpm'

- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV
# - name: Get installed Playwright version
# id: playwright-version
# run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $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 }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}
# This cache causes weird errors on retry runs when using the self-hosted runners, disabling for now
# - name: Cache playwright binaries
# uses: actions/cache@v4
# id: playwright-cache
# with:
# path: |
# ~/.cache/ms-playwright
# key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}

- name: Install dependencies
run: pnpm install
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/utils/email.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Mailsac } from '@mailsac/api'
const EMAIL_CHECK_INTERVAL = 2500
const MAX_EMAIL_CHECK = 48
const MAX_EMAIL_CHECK = 96
const EMAIL_APPROVE_BUTTON_TEXT = 'Approve this login'
const APPROVE_URL_REGEX = /https:\/\/register.*/u
const OTP_CODE_REGEX = /\d{3}\s?\d{3}/u
Expand Down

0 comments on commit 7f3b8c3

Please sign in to comment.