mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
This change introduces 6 different workflows accounting for all of the testing and analysis currently performed in Travis CI & Appveyor: - Checking PHP & JS coding standards are followed - Running the end-to-end test suite. - Running QUnit tests on JavaScript files. - Scanning for PHP compatibility issues with supported version. - Running the PHPUnit test suite. - Verifying NPM related tasks do not cause errors on Windows. Additionally, a seventh workflow is included that will leave a "welcome" comment when a contributor opens their first pull request to the `wordpress-develop` mirror. These workflows are currently in an experimental phase. For that reason, Travis CI and Appveyor will continue to run until all of the bugs can be worked out. Props ayeshrajans, helen, ocean90, desrosj. See #50401. git-svn-id: https://develop.svn.wordpress.org/trunk@49162 602fd350-edb4-49c9-b593-d223f7449a82
68 lines
1.8 KiB
YAML
68 lines
1.8 KiB
YAML
name: JavaScript Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- '*.*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
# Runs the QUnit tests for WordPress.
|
|
#
|
|
# Performs the following steps:
|
|
# - Cancels all previous workflow runs that have not completed.
|
|
# - 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: Cancel previous runs of this workflow
|
|
uses: styfle/cancel-workflow-action@0.5.0
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- 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
|