Skip to content

Commit 0fbe535

Browse files
authored
Skip saucelabs for community contributions (#2321)
1 parent f6029be commit 0fbe535

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/integration-tests-benchmarks.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ jobs:
1616
name: Benchmarks
1717
runs-on: ubuntu-latest
1818

19+
# we copy the secret to the env variable in order to access it in the workflow
20+
env:
21+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
22+
1923
steps:
2024
- name: Git checkout
2125
uses: actions/checkout@v2
@@ -37,22 +41,27 @@ jobs:
3741

3842
- name: Run All Tests in SauceLab
3943
uses: saucelabs/saucectl-run-action@9f8b2c03deea98eb6db7b75bffb1595f2da535db # pin@v1
40-
if: github.event_name != 'pull_request'
44+
if: github.event_name != 'pull_request' && env.SAUCE_USERNAME != null
4145
with:
4246
sauce-username: ${{ secrets.SAUCE_USERNAME }}
4347
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
4448
config-file: .sauce/sentry-uitest-android-benchmark.yml
4549

4650
- name: Run one test in SauceLab
4751
uses: saucelabs/saucectl-run-action@9f8b2c03deea98eb6db7b75bffb1595f2da535db # pin@v1
48-
if: github.event_name == 'pull_request'
52+
if: github.event_name == 'pull_request' && env.SAUCE_USERNAME != null
4953
with:
5054
sauce-username: ${{ secrets.SAUCE_USERNAME }}
5155
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
5256
config-file: .sauce/sentry-uitest-android-benchmark-lite.yml
5357

5458
app-metrics:
5559
runs-on: ubuntu-latest
60+
61+
# we copy the secret to the env variable in order to access it in the workflow
62+
env:
63+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
64+
5665
steps:
5766
- name: Git checkout
5867
uses: actions/checkout@v2
@@ -82,3 +91,4 @@ jobs:
8291
config: sentry-android-integration-tests/metrics-test.yml
8392
sauce-user: ${{ secrets.SAUCE_USERNAME }}
8493
sauce-key: ${{ secrets.SAUCE_ACCESS_KEY }}
94+
if: env.SAUCE_USERNAME != null

.github/workflows/integration-tests-ui.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
name: Ui tests
1212
runs-on: ubuntu-latest
1313

14+
# we copy the secret to the env variable in order to access it in the workflow
15+
env:
16+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
17+
1418
steps:
1519
- name: Git checkout
1620
uses: actions/checkout@v2
@@ -36,3 +40,4 @@ jobs:
3640
sauce-username: ${{ secrets.SAUCE_USERNAME }}
3741
sauce-access-key: ${{ secrets.SAUCE_ACCESS_KEY }}
3842
config-file: .sauce/sentry-uitest-android-ui.yml
43+
if: env.SAUCE_USERNAME != null

0 commit comments

Comments
 (0)