JS Quality Tests #371
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
# Lint & Jest Playwright Test | |
name: JS Quality Tests | |
on: | |
pull_request: | |
workflow_run: | |
workflows: ["Update WP Deps"] | |
types: | |
- completed | |
env: | |
fail-fast: true | |
jobs: | |
test: | |
name: JS Quality Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
if: github.event_name != 'workflow_run' | |
- name: Checkout | |
uses: boxuk/checkout-pr@main | |
id: checkout-deps | |
if: github.event_name == 'workflow_run' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
job-name: JS Quality Tests | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Setup dependencies | |
run: npm install | |
- name: Lint JS | |
run: npm run lint | |
- name: Unit Test | |
run: npm run test | |
- name: Build | |
run: npm run build | |
- name: Mark Check Outcome | |
if: github.event_name == 'workflow_run' && always() | |
uses: boxuk/mark-check-status@main | |
with: | |
status: ${{ job.status }} | |
pr-head-sha: ${{ steps.checkout-deps.outputs.pr-head-sha }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
job-name: JS Quality Tests |