name: Test

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
    paths:
      - '.github/workflows/**'
      - '*.js'
      - 'package.json'

jobs:
  tests:
    env:
      NPM_CONFIG_PROGRESS: "false"

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 6
      - name: Install dependencies
        run: |
          npm install --no-audit
          npm install --no-audit karma-cli karma-sauce-launcher
      - name: Test
        run: npm test
      - name: Test in Sauce Labs
        run: ./node_modules/.bin/karma start karma.conf-sauce.js
        env:
          SAUCE_USERNAME: ${{ secrets.SauceUsername }}
          SAUCE_ACCESS_KEY: ${{ secrets.SauceAccessKey }}
          BUILD_NUMBER: ${{ env.GITHUB_RUN_NUMBER }}
          BUILD_ID: ${{ env.GITHUB_RUN_ID }}
          JOB_NUMBER: ${{ env.GITHUB_JOB }}

name: Test

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
    paths:
      - '.github/workflows/**'
      - 'test/**'
      - '*.js'
      - 'package.json'

jobs:
  tests:
    env:
      NPM_CONFIG_PROGRESS: "false"

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 6
      - name: Install dependencies
        run: |
          npm install --no-audit
          npm install --no-audit karma-cli karma-sauce-launcher
      - name: Test
        run: npm test
      - name: Test in Sauce Labs
        run: ./node_modules/.bin/karma start karma.conf-sauce.js
        env:
          SAUCE_USERNAME: ${{ secrets.SauceUsername }}
          SAUCE_ACCESS_KEY: ${{ secrets.SauceAccessKey }}
          BUILD_NUMBER: ${{ env.GITHUB_RUN_NUMBER }}
          BUILD_ID: ${{ env.GITHUB_RUN_ID }}
          JOB_NUMBER: ${{ env.GITHUB_JOB }}

Include test directory as a condition for running the test workflow
Include test directory as a condition for running the test workflow

Cf #4251
