diff options
Diffstat (limited to '.github/workflows/javascript-tests.yml')
-rw-r--r-- | .github/workflows/javascript-tests.yml | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 31dc88fe3e..0bf9f5a461 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -1,16 +1,36 @@ name: JavaScript Tests on: + # JavaScript testing was introduced in WordPress 3.8. push: branches: - master - # JavaScript testing was introduced in WordPress 3.8. + - trunk - '3.[89]' - '[4-9].[0-9]' tags: - '3.[89]*' - '[4-9].[0-9]*' pull_request: + branches: + - master + - trunk + - '3.[89]' + - '[4-9].[0-9]' + paths: + # Any change to a JavaScript file should run tests. + - '**.js' + # These files configure NPM. Changes could affect the outcome. + - 'package*.json' + # This file configures ESLint. Changes could affect the outcome. + - '.eslintignore' + # This file configures JSHint. Changes could affect the outcome. + - '.jshintrc' + # Any change to the QUnit directory should run tests. + - 'tests/qunit/**' + # Changes to workflow files should always verify all workflows are successful. + - '.github/workflows/*.yml' + workflow_dispatch: jobs: # Runs the QUnit tests for WordPress. @@ -33,12 +53,10 @@ jobs: steps: - name: Cancel previous runs of this workflow (pull requests only) if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} + uses: styfle/cancel-workflow-action@3d86a7cc43670094ac248017207be0295edbc31d # v0.8.0 - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4 - name: Log debug information run: | @@ -48,20 +66,18 @@ jobs: svn --version - name: Install NodeJS - uses: actions/setup-node@v1 + uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.1.5 with: node-version: 14 - name: Cache NodeJS modules - uses: actions/cache@v2 + uses: actions/cache@26968a09c0ea4f3e233fdddbafd1166051a095f6 # v2.1.4 env: cache-name: cache-node-modules with: # npm cache files are stored in `~/.npm` on Linux/macOS path: ~/.npm key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm- - name: Log debug information run: | @@ -69,7 +85,7 @@ jobs: node --version - name: Install Dependencies - run: npx install-changed --install-command="npm ci" + run: npm ci - name: Run QUnit tests run: npm run grunt qunit:compiled |