| 1 |
name: Test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: |
| 6 |
- master |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- master |
| 10 |
paths: |
| 11 |
- '.github/workflows/**' |
| 12 |
- 'test/**' |
| 13 |
- '*.js' |
| 14 |
- 'package.json' |
| 15 |
|
| 16 |
jobs: |
| 17 |
tests: |
| 18 |
env: |
| 19 |
NPM_CONFIG_PROGRESS: "false" |
| 20 |
|
| 21 |
runs-on: ubuntu-latest |
| 22 |
|
| 23 |
steps: |
| 24 |
- uses: actions/checkout@v2 |
| 25 |
- uses: actions/setup-node@v2 |
| 26 |
with: |
| 27 |
node-version: 14 |
| 28 |
cache: 'npm' |
| 29 |
- name: Install dependencies |
| 30 |
run: | |
| 31 |
npm ci |
| 32 |
npm install --no-audit karma-cli karma-sauce-launcher |
| 33 |
- name: Test |
| 34 |
run: npm test |
| 35 |
- name: Test in Sauce Labs |
| 36 |
run: BUILD_NUMBER="$GITHUB_RUN_NUMBER" BUILD_ID="$GITHUB_RUN_ID" JOB_NUMBER="$GITHUB_JOB" ./node_modules/.bin/karma start karma.conf-sauce.js |
| 37 |
env: |
| 38 |
SAUCE_USERNAME: ${{ secrets.SauceUsername }} |
| 39 |
SAUCE_ACCESS_KEY: ${{ secrets.SauceAccessKey }} |