|
| 1 | +name: scheduled tests |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + branch: |
| 7 | + description: 'Branch to run tests against' |
| 8 | + type: string |
| 9 | + required: true |
| 10 | + default: 'main' |
| 11 | + schedule: |
| 12 | + - cron: '0 */2 * * *' # Every 2 hours; disable via GitHub UI or let SCHEDULED_TESTS_UNTIL expire |
| 13 | + |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +env: |
| 18 | + PNPM_VERSION: 9.15.9+sha256.cf86a7ad764406395d4286a6d09d730711720acc6d93e9dce9ac7ac4dc4a28a7 |
| 19 | + |
| 20 | +jobs: |
| 21 | + schedule-gate: |
| 22 | + name: 🗓️ Schedule Gate |
| 23 | + runs-on: ubuntu-latest |
| 24 | + if: github.event_name == 'schedule' |
| 25 | + outputs: |
| 26 | + enabled: ${{ steps.check.outputs.enabled }} |
| 27 | + steps: |
| 28 | + - name: Check SCHEDULED_TESTS_UNTIL |
| 29 | + id: check |
| 30 | + run: | |
| 31 | + until_date="${{ vars.SCHEDULED_TESTS_UNTIL }}" |
| 32 | + if [[ -z "$until_date" ]]; then |
| 33 | + echo "SCHEDULED_TESTS_UNTIL not set — skipping" |
| 34 | + echo "enabled=false" >> "$GITHUB_OUTPUT" |
| 35 | + exit 0 |
| 36 | + fi |
| 37 | + now=$(date -u +%s) |
| 38 | + until=$(date -u -d "$until_date 23:59:59" +%s) |
| 39 | + if (( now <= until )); then |
| 40 | + echo "Schedule active until $until_date" |
| 41 | + echo "enabled=true" >> "$GITHUB_OUTPUT" |
| 42 | + else |
| 43 | + echo "Schedule window expired on $until_date" |
| 44 | + echo "enabled=false" >> "$GITHUB_OUTPUT" |
| 45 | + fi |
| 46 | +
|
| 47 | + scheduled-desktop-web: |
| 48 | + name: 🗓️ 💻 Scheduled Desktop Web Tests on LambdaTest |
| 49 | + runs-on: ubuntu-latest |
| 50 | + needs: [schedule-gate] |
| 51 | + if: >- |
| 52 | + always() && ( |
| 53 | + github.event_name == 'workflow_dispatch' || |
| 54 | + (github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true') |
| 55 | + ) |
| 56 | + steps: |
| 57 | + - name: ⬇️ Checkout Repository |
| 58 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 59 | + with: |
| 60 | + ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }} |
| 61 | + |
| 62 | + - name: 📦 Setup pnpm |
| 63 | + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 |
| 64 | + with: |
| 65 | + version: ${{ env.PNPM_VERSION }} |
| 66 | + |
| 67 | + - name: 🟢 Setup Node.js |
| 68 | + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 |
| 69 | + with: |
| 70 | + node-version-file: ".nvmrc" |
| 71 | + cache: pnpm |
| 72 | + |
| 73 | + - name: 🧩 Install Dependencies |
| 74 | + run: pnpm pnpm.install.workaround |
| 75 | + |
| 76 | + - name: 🏗️ Build |
| 77 | + working-directory: ./ |
| 78 | + run: pnpm build |
| 79 | + |
| 80 | + - name: 🧪 Run linting and unit tests |
| 81 | + working-directory: ./ |
| 82 | + run: pnpm test |
| 83 | + |
| 84 | + - name: 🖥️ 🌐 Run Desktop Web e2e tests |
| 85 | + working-directory: ./ |
| 86 | + env: |
| 87 | + LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }} |
| 88 | + LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }} |
| 89 | + BUILD_PREFIX: true |
| 90 | + run: pnpm test.lambdatest.desktop --maxConcurrency=4 |
| 91 | + |
| 92 | + - name: 📤 Upload artifacts |
| 93 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 94 | + if: failure() |
| 95 | + with: |
| 96 | + name: scheduled-desktop-web-logs |
| 97 | + path: | |
| 98 | + logs/*.log |
| 99 | + .tmp/ |
| 100 | + !.tmp/checkActual/ |
| 101 | + !.tmp/saveActual/ |
| 102 | + !.tmp/testDiff/ |
| 103 | + !.next/ |
| 104 | +
|
| 105 | + scheduled-android-web: |
| 106 | + name: 🗓️ 🤖 🌐 Scheduled Android Web Tests on LambdaTest |
| 107 | + runs-on: ubuntu-latest |
| 108 | + needs: [schedule-gate] |
| 109 | + if: >- |
| 110 | + always() && ( |
| 111 | + github.event_name == 'workflow_dispatch' || |
| 112 | + (github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true') |
| 113 | + ) |
| 114 | + steps: |
| 115 | + - name: ⬇️ Checkout Repository |
| 116 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 117 | + with: |
| 118 | + ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }} |
| 119 | + |
| 120 | + - name: 📦 Setup pnpm |
| 121 | + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 |
| 122 | + with: |
| 123 | + version: ${{ env.PNPM_VERSION }} |
| 124 | + |
| 125 | + - name: 🟢 Setup Node.js |
| 126 | + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 |
| 127 | + with: |
| 128 | + node-version-file: ".nvmrc" |
| 129 | + cache: pnpm |
| 130 | + |
| 131 | + - name: 🧩 Install Dependencies |
| 132 | + run: pnpm pnpm.install.workaround |
| 133 | + |
| 134 | + - name: 🏗️ Build |
| 135 | + working-directory: ./ |
| 136 | + run: pnpm build |
| 137 | + |
| 138 | + - name: 🧪 Run linting and unit tests |
| 139 | + working-directory: ./ |
| 140 | + run: pnpm test |
| 141 | + |
| 142 | + - name: 🤖 🌐 Run Android Web e2e tests |
| 143 | + working-directory: ./ |
| 144 | + env: |
| 145 | + LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }} |
| 146 | + LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }} |
| 147 | + BUILD_PREFIX: true |
| 148 | + run: pnpm test.lambdatest.emu.web --maxConcurrency=6 |
| 149 | + |
| 150 | + - name: 📤 Upload artifacts |
| 151 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 152 | + if: failure() |
| 153 | + with: |
| 154 | + name: scheduled-android-web-logs |
| 155 | + path: | |
| 156 | + logs/*.log |
| 157 | + .tmp/ |
| 158 | + !.tmp/checkActual/ |
| 159 | + !.tmp/saveActual/ |
| 160 | + !.tmp/testDiff/ |
| 161 | + !.next/ |
| 162 | +
|
| 163 | + scheduled-ios-web: |
| 164 | + name: 🗓️ 🍏 🌐 Scheduled iOS Web Tests on LambdaTest |
| 165 | + runs-on: ubuntu-latest |
| 166 | + needs: [schedule-gate] |
| 167 | + if: >- |
| 168 | + always() && ( |
| 169 | + github.event_name == 'workflow_dispatch' || |
| 170 | + (github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true') |
| 171 | + ) |
| 172 | + steps: |
| 173 | + - name: ⬇️ Checkout Repository |
| 174 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 175 | + with: |
| 176 | + ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }} |
| 177 | + |
| 178 | + - name: 📦 Setup pnpm |
| 179 | + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 |
| 180 | + with: |
| 181 | + version: ${{ env.PNPM_VERSION }} |
| 182 | + |
| 183 | + - name: 🟢 Setup Node.js |
| 184 | + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 |
| 185 | + with: |
| 186 | + node-version-file: ".nvmrc" |
| 187 | + cache: pnpm |
| 188 | + |
| 189 | + - name: 🧩 Install Dependencies |
| 190 | + run: pnpm pnpm.install.workaround |
| 191 | + |
| 192 | + - name: 🏗️ Build |
| 193 | + working-directory: ./ |
| 194 | + run: pnpm build |
| 195 | + |
| 196 | + - name: 🧪 Run linting and unit tests |
| 197 | + working-directory: ./ |
| 198 | + run: pnpm test |
| 199 | + |
| 200 | + - name: 🍏 🌐 Run iOS Web e2e tests |
| 201 | + working-directory: ./ |
| 202 | + env: |
| 203 | + LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }} |
| 204 | + LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }} |
| 205 | + BUILD_PREFIX: true |
| 206 | + run: pnpm test.lambdatest.sims.web --maxConcurrency=6 |
| 207 | + |
| 208 | + - name: 📤 Upload artifacts |
| 209 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 210 | + if: failure() |
| 211 | + with: |
| 212 | + name: scheduled-ios-web-logs |
| 213 | + path: | |
| 214 | + logs/*.log |
| 215 | + .tmp/ |
| 216 | + !.tmp/checkActual/ |
| 217 | + !.tmp/saveActual/ |
| 218 | + !.tmp/testDiff/ |
| 219 | + !.next/ |
| 220 | +
|
| 221 | + scheduled-app: |
| 222 | + name: 🗓️ 📱 Scheduled Mobile App Tests on Sauce |
| 223 | + runs-on: ubuntu-latest |
| 224 | + needs: [schedule-gate] |
| 225 | + if: >- |
| 226 | + always() && ( |
| 227 | + github.event_name == 'workflow_dispatch' || |
| 228 | + (github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true') |
| 229 | + ) |
| 230 | + steps: |
| 231 | + - name: ⬇️ Checkout Repository |
| 232 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 233 | + with: |
| 234 | + ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }} |
| 235 | + |
| 236 | + - name: 📦 Setup pnpm |
| 237 | + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 |
| 238 | + with: |
| 239 | + version: ${{ env.PNPM_VERSION }} |
| 240 | + |
| 241 | + - name: 🟢 Setup Node.js |
| 242 | + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 |
| 243 | + with: |
| 244 | + node-version-file: ".nvmrc" |
| 245 | + cache: pnpm |
| 246 | + |
| 247 | + - name: 🧩 Install Dependencies |
| 248 | + run: pnpm pnpm.install.workaround |
| 249 | + |
| 250 | + - name: 🏗️ Build |
| 251 | + working-directory: ./ |
| 252 | + run: pnpm build |
| 253 | + |
| 254 | + - name: 🧪 Run linting and unit tests |
| 255 | + working-directory: ./ |
| 256 | + run: pnpm test |
| 257 | + |
| 258 | + - name: 😶🌫️ 📱 Run App e2e tests |
| 259 | + working-directory: ./ |
| 260 | + env: |
| 261 | + SAUCE_USERNAME_WDIO_ICS: ${{ secrets.SAUCE_USERNAME_WDIO_ICS }} |
| 262 | + SAUCE_ACCESS_KEY_WDIO_ICS: ${{ secrets.SAUCE_ACCESS_KEY_WDIO_ICS }} |
| 263 | + BUILD_PREFIX: true |
| 264 | + run: pnpm test.saucelabs.app --maxConcurrency=20 |
| 265 | + |
| 266 | + - name: 📤 Upload artifacts |
| 267 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 268 | + if: failure() |
| 269 | + with: |
| 270 | + name: scheduled-mobile-app-logs |
| 271 | + path: | |
| 272 | + logs/*.log |
| 273 | + .tmp/ |
| 274 | + !.tmp/checkActual/ |
| 275 | + !.tmp/saveActual/ |
| 276 | + !.tmp/testDiff/ |
| 277 | + !.next/ |
| 278 | +
|
| 279 | + scheduled-ocr: |
| 280 | + name: 🗓️ 🔎 Scheduled OCR Tests on LambdaTest |
| 281 | + runs-on: ubuntu-latest |
| 282 | + needs: [schedule-gate] |
| 283 | + if: >- |
| 284 | + always() && ( |
| 285 | + github.event_name == 'workflow_dispatch' || |
| 286 | + (github.event_name == 'schedule' && needs.schedule-gate.outputs.enabled == 'true') |
| 287 | + ) |
| 288 | + steps: |
| 289 | + - name: ⬇️ Checkout Repository |
| 290 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 291 | + with: |
| 292 | + ref: ${{ inputs.branch || vars.SCHEDULED_TESTS_BRANCH || 'main' }} |
| 293 | + |
| 294 | + - name: 📦 Setup pnpm |
| 295 | + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 |
| 296 | + with: |
| 297 | + version: ${{ env.PNPM_VERSION }} |
| 298 | + |
| 299 | + - name: 🟢 Setup Node.js |
| 300 | + uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 |
| 301 | + with: |
| 302 | + node-version-file: ".nvmrc" |
| 303 | + cache: pnpm |
| 304 | + |
| 305 | + - name: 🧩 Install Dependencies |
| 306 | + run: pnpm pnpm.install.workaround |
| 307 | + |
| 308 | + - name: 🏗️ Build |
| 309 | + working-directory: ./ |
| 310 | + run: pnpm build |
| 311 | + |
| 312 | + - name: 🧪 Run linting and unit tests |
| 313 | + working-directory: ./ |
| 314 | + run: pnpm test |
| 315 | + |
| 316 | + - name: 😶🌫️ 🔎 Run OCR e2e tests |
| 317 | + working-directory: ./ |
| 318 | + env: |
| 319 | + LAMBDATEST_USERNAME: ${{ secrets.LAMBDATEST_USERNAME }} |
| 320 | + LAMBDATEST_ACCESS_KEY: ${{ secrets.LAMBDATEST_ACCESS_KEY }} |
| 321 | + BUILD_PREFIX: true |
| 322 | + run: pnpm test.ocr.lambdatest.desktop --maxConcurrency=1 |
| 323 | + |
| 324 | + - name: 📤 Upload artifacts |
| 325 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 326 | + if: failure() |
| 327 | + with: |
| 328 | + name: scheduled-ocr-logs |
| 329 | + path: | |
| 330 | + logs/*.log |
| 331 | + .tmp/ |
| 332 | + !.next/ |
0 commit comments