Block Editor Form Validation #2018
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'JS Tests' | |
on: | |
pull_request: | |
paths: | |
- 'ui/js/**' | |
- 'package.json' | |
- 'webpack.*.js' | |
- 'jest-setup-wordpress-globals.js' | |
- 'jest.config.json' | |
- '.github/workflows/tests-js.yml' | |
jobs: | |
test: | |
strategy: | |
matrix: | |
suite: [ 'jest' ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm ci --force --legacy-peer-deps | |
- name: Run JS test suite | |
run: npm run ${{ matrix.suite }} |