From 2595ff3e84df40ad73d9e1c062dcb9c823b0df23 Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Tue, 12 Sep 2023 11:38:22 -0400 Subject: [PATCH] ci: move saucelabs browser testing to GHA --- .circleci/dynamic_config.yml | 7 ++++++ .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++----- scripts/saucelabs/start-tunnel.sh | 3 --- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.circleci/dynamic_config.yml b/.circleci/dynamic_config.yml index ce4d06b013..4a4a78e0ea 100644 --- a/.circleci/dynamic_config.yml +++ b/.circleci/dynamic_config.yml @@ -30,6 +30,12 @@ var_3: &default_nodeversion '18.13' # https://circleci.com/blog/deep-diving-into-circleci-workspaces/ var_4: &workspace_location . +var_6: &only_pull_requests + filters: + branches: + only: + - /pull\/\d+/ + var_7: &only_builds_branches filters: branches: @@ -193,6 +199,7 @@ workflows: - setup - test-browsers: + <<: *only_pull_requests requires: - build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c5912c252..13c541c844 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -93,8 +93,6 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d - with: - fetch-depth: 1 - name: Setup Bazel uses: angular/dev-infra/github-actions/bazel/setup@4ccf7eed68bba0d25f7edd47997852774f61755d - name: Setup Bazel RBE @@ -124,8 +122,6 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d - with: - fetch-depth: 1 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel @@ -149,8 +145,6 @@ jobs: steps: - name: Initialize environment uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d - with: - fetch-depth: 1 - name: Install node modules run: yarn install --frozen-lockfile - name: Setup Bazel @@ -159,3 +153,38 @@ jobs: uses: angular/dev-infra/github-actions/bazel/configure-remote@4ccf7eed68bba0d25f7edd47997852774f61755d - name: Run CLI E2E tests run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }} + + browsers: + if: github.event_name == 'push' + runs-on: ubuntu-latest + name: Browser Compatibility Tests + env: + SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }} + steps: + - name: Initialize environment + uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@395903265d96198c141160912e73787d4a1ca324 + - name: Install node modules + run: yarn install --frozen-lockfile + - name: Setup Bazel + uses: angular/dev-infra/github-actions/bazel/setup@395903265d96198c141160912e73787d4a1ca324 + - name: Setup Bazel RBE + uses: angular/dev-infra/github-actions/bazel/configure-remote@395903265d96198c141160912e73787d4a1ca324 + - name: Run E2E Browser tests + env: + SAUCE_USERNAME: ${{ vars.SAUCE_USERNAME }} + SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} + SAUCE_LOG_FILE: /tmp/angular/sauce-connect.log + SAUCE_READY_FILE: /tmp/angular/sauce-connect-ready-file.lock + SAUCE_PID_FILE: /tmp/angular/sauce-connect-pid-file.lock + SAUCE_TUNNEL_IDENTIFIER: 'angular-${{ github.run_number }}' + SAUCE_READY_FILE_TIMEOUT: 120 + run: | + ./scripts/saucelabs/start-tunnel.sh & + ./scripts/saucelabs/wait-for-tunnel.sh + yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs + ./scripts/saucelabs/stop-tunnel.sh + - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + if: ${{ failure() }} + with: + name: sauce-connect-log + path: ${{ env.SAUCE_CONNECT_DIR_IN_HOST }}/sauce-connect.log diff --git a/scripts/saucelabs/start-tunnel.sh b/scripts/saucelabs/start-tunnel.sh index 8aeaa8a25c..48cd465586 100755 --- a/scripts/saucelabs/start-tunnel.sh +++ b/scripts/saucelabs/start-tunnel.sh @@ -26,9 +26,6 @@ if [[ ! -z "${SAUCE_PID_FILE:-}" ]]; then sauceArgs="${sauceArgs} --pidfile ${SAUCE_PID_FILE}" fi -if [[ ! -z "${SAUCE_TUNNEL_IDENTIFIER:-}" ]]; then - sauceArgs="${sauceArgs} --tunnel-identifier ${SAUCE_TUNNEL_IDENTIFIER}" -fi echo "Starting Sauce Connect. Passed arguments: ${sauceArgs}"