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
332 changes: 332 additions & 0 deletions .github/workflows/scheduled-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,332 @@
name: scheduled tests

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to run tests against'
type: string
required: true
default: 'main'
schedule:
- cron: '0 */2 * * *' # Every 2 hours; disable via GitHub UI or let SCHEDULED_TESTS_UNTIL expire

permissions:
contents: read

env:
PNPM_VERSION: 9.15.9+sha256.cf86a7ad764406395d4286a6d09d730711720acc6d93e9dce9ac7ac4dc4a28a7

jobs:
schedule-gate:
name: 🗓️ Schedule Gate
runs-on: ubuntu-latest
if: github.event_name == 'schedule'
outputs:
enabled: ${{ steps.check.outputs.enabled }}
steps:
- name: Check SCHEDULED_TESTS_UNTIL
id: check
run: |
until_date="${{ vars.SCHEDULED_TESTS_UNTIL }}"
if [[ -z "$until_date" ]]; then
echo "SCHEDULED_TESTS_UNTIL not set — skipping"
echo "enabled=false" >> "$GITHUB_OUTPUT"
exit 0
fi
now=$(date -u +%s)
until=$(date -u -d "$until_date 23:59:59" +%s)
if (( now <= until )); then
echo "Schedule active until $until_date"
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "Schedule window expired on $until_date"
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi

scheduled-desktop-web:
name: 🗓️ 💻 Scheduled Desktop Web Tests on LambdaTest
runs-on: ubuntu-latest
needs: [schedule-gate]
if: >-
always() && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true')
)
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: ${{ env.PNPM_VERSION }}

- name: 🟢 Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: 🧩 Install Dependencies
run: pnpm pnpm.install.workaround

- name: 🏗️ Build
working-directory: ./
run: pnpm build

- name: 🧪 Run linting and unit tests
working-directory: ./
run: pnpm test

- name: 🖥️ 🌐 Run Desktop Web e2e tests
working-directory: ./
env:
LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }}
LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }}
BUILD_PREFIX: true
run: pnpm test.lambdatest.desktop --maxConcurrency=4

- name: 📤 Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: scheduled-desktop-web-logs
path: |
logs/*.log
.tmp/
!.tmp/checkActual/
!.tmp/saveActual/
!.tmp/testDiff/
!.next/

scheduled-android-web:
name: 🗓️ 🤖 🌐 Scheduled Android Web Tests on LambdaTest
runs-on: ubuntu-latest
needs: [schedule-gate]
if: >-
always() && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true')
)
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: ${{ env.PNPM_VERSION }}

- name: 🟢 Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: 🧩 Install Dependencies
run: pnpm pnpm.install.workaround

- name: 🏗️ Build
working-directory: ./
run: pnpm build

- name: 🧪 Run linting and unit tests
working-directory: ./
run: pnpm test

- name: 🤖 🌐 Run Android Web e2e tests
working-directory: ./
env:
LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }}
LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }}
BUILD_PREFIX: true
run: pnpm test.lambdatest.emu.web --maxConcurrency=6

- name: 📤 Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: scheduled-android-web-logs
path: |
logs/*.log
.tmp/
!.tmp/checkActual/
!.tmp/saveActual/
!.tmp/testDiff/
!.next/

scheduled-ios-web:
name: 🗓️ 🍏 🌐 Scheduled iOS Web Tests on LambdaTest
runs-on: ubuntu-latest
needs: [schedule-gate]
if: >-
always() && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true')
)
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: ${{ env.PNPM_VERSION }}

- name: 🟢 Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: 🧩 Install Dependencies
run: pnpm pnpm.install.workaround

- name: 🏗️ Build
working-directory: ./
run: pnpm build

- name: 🧪 Run linting and unit tests
working-directory: ./
run: pnpm test

- name: 🍏 🌐 Run iOS Web e2e tests
working-directory: ./
env:
LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }}
LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }}
BUILD_PREFIX: true
run: pnpm test.lambdatest.sims.web --maxConcurrency=6

- name: 📤 Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: scheduled-ios-web-logs
path: |
logs/*.log
.tmp/
!.tmp/checkActual/
!.tmp/saveActual/
!.tmp/testDiff/
!.next/

scheduled-app:
name: 🗓️ 📱 Scheduled Mobile App Tests on Sauce
runs-on: ubuntu-latest
needs: [schedule-gate]
if: >-
always() && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true')
)
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: ${{ env.PNPM_VERSION }}

- name: 🟢 Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: 🧩 Install Dependencies
run: pnpm pnpm.install.workaround

- name: 🏗️ Build
working-directory: ./
run: pnpm build

- name: 🧪 Run linting and unit tests
working-directory: ./
run: pnpm test

- name: 😶‍🌫️ 📱 Run App e2e tests
working-directory: ./
env:
SAUCE_USERNAME_WDIO_ICS: ${{ secrets.SAUCE_USERNAME_WDIO_ICS }}
SAUCE_ACCESS_KEY_WDIO_ICS: ${{ secrets.SAUCE_ACCESS_KEY_WDIO_ICS }}
BUILD_PREFIX: true
run: pnpm test.saucelabs.app --maxConcurrency=20

- name: 📤 Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: scheduled-mobile-app-logs
path: |
logs/*.log
.tmp/
!.tmp/checkActual/
!.tmp/saveActual/
!.tmp/testDiff/
!.next/

scheduled-ocr:
name: 🗓️ 🔎 Scheduled OCR Tests on LambdaTest
runs-on: ubuntu-latest
needs: [schedule-gate]
if: >-
always() && (
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true')
)
steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }}

- name: 📦 Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: ${{ env.PNPM_VERSION }}

- name: 🟢 Setup Node.js
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: 🧩 Install Dependencies
run: pnpm pnpm.install.workaround

- name: 🏗️ Build
working-directory: ./
run: pnpm build

- name: 🧪 Run linting and unit tests
working-directory: ./
run: pnpm test

- name: 😶‍🌫️ 🔎 Run OCR e2e tests
working-directory: ./
env:
LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }}
LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }}
BUILD_PREFIX: true
run: pnpm test.ocr.lambdatest.desktop --maxConcurrency=1

- name: 📤 Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
if: failure()
with:
name: scheduled-ocr-logs
path: |
logs/*.log
.tmp/
!.next/
Loading
Loading