-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.66 KB
/
tests-js.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
strategy:
fail-fast: true
matrix:
node-version: [22]
name: Test JS (node ${{ matrix.node-version }})
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 (node ${{ matrix.node-version }})
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Setup dependencies
run: 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 (node ${{ matrix.node-version }})