Wordpress/.github/workflows/javascript-tests.yml
Jonathan Desrosiers 285048ed3f Build/Test Tools: Do not cancel previous workflow runs.
When a workflow is cancelled, it’s marked as a failure. This is not ideal because the commit attached to the workflow run will appear as though it introduced a problem, but this may not be true.

Because GitHub Actions work a bit differently than Travis builds, it’s unlikely that the same bottleneck will be encountered in workflows.

This change removes all workflow job steps that cancel previous workflows.

See #50401.

git-svn-id: https://develop.svn.wordpress.org/trunk@49168 602fd350-edb4-49c9-b593-d223f7449a82
2020-10-16 00:25:18 +00:00

62 lines
1.5 KiB
YAML

name: JavaScript Tests
on:
push:
branches:
- master
- '*.*'
pull_request:
jobs:
# Runs the QUnit tests for WordPress.
#
# Performs the following steps:
# - Checks out the repository.
# - Logs debug information about the runner container.
# - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches)
# - Sets up caching for NPM.
# - Logs updated debug information.
# _ Installs NPM dependencies.
# - Run the WordPress QUnit tests.
# - todo: Configure Slack notifications for failing tests.
test-js:
name: QUnit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Log debug information
run: |
npm --version
node --version
git --version
svn --version
- name: Install NodeJS
uses: actions/setup-node@v1
with:
node-version: 12
- name: Cache NodeJS modules
uses: actions/cache@v2
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: |
npm --version
node --version
- name: Install Dependencies
run: npm ci
- name: Run QUnit tests
run: npm run grunt qunit:compiled