|
20 | 20 | cancel-in-progress: true |
21 | 21 | outputs: |
22 | 22 | canUseSauce: ${{ steps.check_sauce_access.outputs.result == 'true' }} |
| 23 | + canUseBrowserStack: ${{ steps.check_browserstack_access.outputs.result == 'true' }} |
23 | 24 | tag: ${{ steps.extract_tag.outputs.result }} |
24 | 25 | isMainBranch: ${{ github.ref == 'refs/heads/master' }} |
25 | 26 | steps: |
|
33 | 34 | CI: true |
34 | 35 | SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} |
35 | 36 | SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} |
| 37 | + - name: check browserstack access |
| 38 | + id: check_browserstack_access |
| 39 | + run: | |
| 40 | + if ! [[ -z "$BROWSERSTACK_USERNAME" ]] && ! [[ -z "$BROWSERSTACK_ACCESS_KEY" ]]; then |
| 41 | + echo "result=true" >> $GITHUB_OUTPUT |
| 42 | + fi |
| 43 | + env: |
| 44 | + CI: true |
| 45 | + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 46 | + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
36 | 47 | - name: extract tag |
37 | 48 | id: extract_tag |
38 | 49 | uses: actions/github-script@v8 |
@@ -418,16 +429,9 @@ jobs: |
418 | 429 | max-parallel: 8 |
419 | 430 | matrix: |
420 | 431 | include: |
421 | | - - config: safari-macOS_13 |
422 | | - ua: safari |
423 | | - os: macOS 13 |
424 | 432 | - config: firefox-win_10 |
425 | 433 | ua: firefox |
426 | 434 | os: Windows 10 |
427 | | - - config: chrome-mac_13-79.0 |
428 | | - ua: chrome |
429 | | - os: macOS 12 |
430 | | - uaVersion: '79.0' |
431 | 435 |
|
432 | 436 | steps: |
433 | 437 | - uses: actions/checkout@v5 |
@@ -479,3 +483,81 @@ jobs: |
479 | 483 | UA: ${{ matrix.ua }} |
480 | 484 | UA_VERSION: ${{ matrix.uaVersion }} |
481 | 485 | OS: ${{ matrix.os }} |
| 486 | + |
| 487 | + test_functional_browserstack: |
| 488 | + needs: [config, test_unit] |
| 489 | + if: needs.config.outputs.canUseBrowserStack == 'true' |
| 490 | + runs-on: ubuntu-latest |
| 491 | + concurrency: |
| 492 | + group: 'build:test_functional_browserstack:${{ matrix.config }}:${{ github.ref }}' |
| 493 | + cancel-in-progress: true |
| 494 | + continue-on-error: true |
| 495 | + name: test_functional_browserstack (${{ matrix.config }}) |
| 496 | + strategy: |
| 497 | + fail-fast: false |
| 498 | + max-parallel: 4 |
| 499 | + matrix: |
| 500 | + include: |
| 501 | + - config: safari-macOS_15 |
| 502 | + ua: safari |
| 503 | + os: macOS 15 |
| 504 | + - config: chrome-macOS_14 |
| 505 | + ua: chrome |
| 506 | + os: macOS 14 |
| 507 | + |
| 508 | + steps: |
| 509 | + - uses: actions/checkout@v5 |
| 510 | + |
| 511 | + - name: cache node_modules |
| 512 | + uses: actions/cache@v4 |
| 513 | + env: |
| 514 | + cache-name: cache-node-modules |
| 515 | + with: |
| 516 | + path: ~/.npm |
| 517 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} |
| 518 | + restore-keys: | |
| 519 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 520 | + ${{ runner.os }}-build- |
| 521 | + ${{ runner.os }}- |
| 522 | +
|
| 523 | + - name: use Node.js |
| 524 | + uses: actions/setup-node@v5 |
| 525 | + with: |
| 526 | + node-version-file: '.node-version' |
| 527 | + |
| 528 | + - name: download build |
| 529 | + uses: actions/download-artifact@v5 |
| 530 | + with: |
| 531 | + name: build |
| 532 | + |
| 533 | + - name: start BrowserStack Local |
| 534 | + uses: browserstack/github-actions/setup-local@master |
| 535 | + with: |
| 536 | + local-testing: start |
| 537 | + local-identifier: ${{ github.run_id }}-${{ matrix.config }} |
| 538 | + |
| 539 | + - name: install |
| 540 | + run: | |
| 541 | + npm ci |
| 542 | + env: |
| 543 | + CI: true |
| 544 | + |
| 545 | + - name: run functional tests |
| 546 | + run: | |
| 547 | + npm run test:func |
| 548 | + env: |
| 549 | + CI: true |
| 550 | + BROWSERSTACK: 1 |
| 551 | + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 552 | + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 553 | + BROWSERSTACK_LOCAL_IDENTIFIER: ${{ github.run_id }}-${{ matrix.config }} |
| 554 | + BROWSERSTACK_BUILD_ID: ${{ github.run_id }}-${{ matrix.config }} |
| 555 | + UA: ${{ matrix.ua }} |
| 556 | + UA_VERSION: ${{ matrix.uaVersion }} |
| 557 | + OS: ${{ matrix.os }} |
| 558 | + |
| 559 | + - name: stop BrowserStack Local |
| 560 | + if: always() |
| 561 | + uses: browserstack/github-actions/setup-local@master |
| 562 | + with: |
| 563 | + local-testing: stop |
0 commit comments