Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run browser tests on forked PRs by a dedicated label #4616

Merged
merged 4 commits into from
Apr 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/browser-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Browser Tests for forked PRs
'on':
pull_request_target:
types:
- labeled

jobs:
test-browser:
# TODO: configure to retain build artifacts in `.karma/` dir
name: 'Browser Tests'
timeout-minutes: 20
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'run-browser-test')
steps:
- uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: 'Cache node_modules'
uses: actions/cache@v2
with:
path: '~/.npm'
key: "ubuntu-latest-node-full-v14-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
ubuntu-latest-node-full-v14-
- name: Install Dependencies
run: npm ci
- name: Run Browser Tests
run: npm start test.browser
env:
SAUCE_USERNAME: '${{secrets.SAUCE_USERNAME}}'
SAUCE_ACCESS_KEY: '${{secrets.SAUCE_ACCESS_KEY}}'
- name: remove 'run-browser-test' label
uses: buildsville/add-remove-label@v1
if: ${{ always() }}
with:
token: ${{secrets.GITHUB_TOKEN}}
label: run-browser-test
type: remove
2 changes: 2 additions & 0 deletions .github/workflows/mocha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ jobs:
needs: smoke
timeout-minutes: 20
runs-on: ubuntu-latest
# Run 'push' event only because of sauce labs token
if: github.event_name == 'push'
steps:
- uses: actions/setup-node@v2
with:
Expand Down