Skip to content

JS Quality Tests

JS Quality Tests #630

Workflow file for this run

name: JS Quality Tests
on:
pull_request:
workflow_run:
workflows: ["Update WP Deps"]
types:
- completed
permissions:
issues: write
pull-requests: write
contents: write
checks: write
statuses: write
env:
fail-fast: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
name: Test JS
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: Test JS
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- name: Setup dependencies
run: npm i -g npm@latest && npm ci
- name: Lint JS
run: npm run lint
- name: Unit Test
run: npm run test
- name: Type Coverage
run: npm run type-coverage
- 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: Test JS