Skip to content

Commit

Permalink
ci: move saucelabs browser testing to GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin authored and alan-agius4 committed Oct 30, 2023
1 parent bb13e40 commit 2595ff3
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .circleci/dynamic_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -193,6 +199,7 @@ workflows:
- setup

- test-browsers:
<<: *only_pull_requests
requires:
- build

Expand Down
41 changes: 35 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
3 changes: 0 additions & 3 deletions scripts/saucelabs/start-tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit 2595ff3

Please sign in to comment.