Skip to content

Commit d5ec585

Browse files
clydinalan-agius4
authored andcommitted
ci: move saucelabs browser testing to GHA
(cherry picked from commit 2595ff3)
1 parent c013a95 commit d5ec585

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

.circleci/dynamic_config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ var_3: &default_nodeversion '18.13'
3030
# https://circleci.com/blog/deep-diving-into-circleci-workspaces/
3131
var_4: &workspace_location .
3232

33+
var_6: &only_pull_requests
34+
filters:
35+
branches:
36+
only:
37+
- /pull\/\d+/
38+
3339
var_7: &only_builds_branches
3440
filters:
3541
branches:
@@ -193,6 +199,7 @@ workflows:
193199
- setup
194200

195201
- test-browsers:
202+
<<: *only_pull_requests
196203
requires:
197204
- build
198205

.github/workflows/ci.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ jobs:
9393
steps:
9494
- name: Initialize environment
9595
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d
96-
with:
97-
fetch-depth: 1
9896
- name: Setup Bazel
9997
uses: angular/dev-infra/github-actions/bazel/setup@4ccf7eed68bba0d25f7edd47997852774f61755d
10098
- name: Setup Bazel RBE
@@ -124,8 +122,6 @@ jobs:
124122
steps:
125123
- name: Initialize environment
126124
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d
127-
with:
128-
fetch-depth: 1
129125
- name: Install node modules
130126
run: yarn install --frozen-lockfile
131127
- name: Setup Bazel
@@ -149,8 +145,6 @@ jobs:
149145
steps:
150146
- name: Initialize environment
151147
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@4ccf7eed68bba0d25f7edd47997852774f61755d
152-
with:
153-
fetch-depth: 1
154148
- name: Install node modules
155149
run: yarn install --frozen-lockfile
156150
- name: Setup Bazel
@@ -159,3 +153,38 @@ jobs:
159153
uses: angular/dev-infra/github-actions/bazel/configure-remote@4ccf7eed68bba0d25f7edd47997852774f61755d
160154
- name: Run CLI E2E tests
161155
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 }}
156+
157+
browsers:
158+
if: github.event_name == 'push'
159+
runs-on: ubuntu-latest
160+
name: Browser Compatibility Tests
161+
env:
162+
SAUCE_TUNNEL_IDENTIFIER: angular-cli-${{ github.workflow }}-${{ github.run_number }}
163+
steps:
164+
- name: Initialize environment
165+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@395903265d96198c141160912e73787d4a1ca324
166+
- name: Install node modules
167+
run: yarn install --frozen-lockfile
168+
- name: Setup Bazel
169+
uses: angular/dev-infra/github-actions/bazel/setup@395903265d96198c141160912e73787d4a1ca324
170+
- name: Setup Bazel RBE
171+
uses: angular/dev-infra/github-actions/bazel/configure-remote@395903265d96198c141160912e73787d4a1ca324
172+
- name: Run E2E Browser tests
173+
env:
174+
SAUCE_USERNAME: ${{ vars.SAUCE_USERNAME }}
175+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
176+
SAUCE_LOG_FILE: /tmp/angular/sauce-connect.log
177+
SAUCE_READY_FILE: /tmp/angular/sauce-connect-ready-file.lock
178+
SAUCE_PID_FILE: /tmp/angular/sauce-connect-pid-file.lock
179+
SAUCE_TUNNEL_IDENTIFIER: 'angular-${{ github.run_number }}'
180+
SAUCE_READY_FILE_TIMEOUT: 120
181+
run: |
182+
./scripts/saucelabs/start-tunnel.sh &
183+
./scripts/saucelabs/wait-for-tunnel.sh
184+
yarn bazel test --config=saucelabs //tests/legacy-cli:e2e.saucelabs
185+
./scripts/saucelabs/stop-tunnel.sh
186+
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
187+
if: ${{ failure() }}
188+
with:
189+
name: sauce-connect-log
190+
path: ${{ env.SAUCE_CONNECT_DIR_IN_HOST }}/sauce-connect.log

scripts/saucelabs/start-tunnel.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ if [[ ! -z "${SAUCE_PID_FILE:-}" ]]; then
2626
sauceArgs="${sauceArgs} --pidfile ${SAUCE_PID_FILE}"
2727
fi
2828

29-
if [[ ! -z "${SAUCE_TUNNEL_IDENTIFIER:-}" ]]; then
30-
sauceArgs="${sauceArgs} --tunnel-identifier ${SAUCE_TUNNEL_IDENTIFIER}"
31-
fi
3229

3330
echo "Starting Sauce Connect. Passed arguments: ${sauceArgs}"
3431

0 commit comments

Comments
 (0)