-
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (61 loc) · 1.91 KB
/
pull-request.yml
File metadata and controls
79 lines (61 loc) · 1.91 KB
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
71
72
73
74
75
76
77
78
79
name: Pull Request
on:
pull_request:
paths:
- '.github/actions/**'
- '.github/workflows/**'
- 'code/**'
env:
node-version: 22.x
working-directory: ./code
jobs:
format:
name: Run linting & formatting
runs-on: ubuntu-latest
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
defaults:
run:
working-directory: ${{ env.working-directory }}
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout the Git repository
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
- name: Use Node.js ${{ env.node-version }}
uses: ./.github/actions/setup-node
with:
node-version: ${{ env.node-version }}
- name: Install Node modules
uses: ./.github/actions/install-node-modules
- name: Format code
uses: ./.github/actions/format-code
- name: Commit & push format changes
uses: ./.github/actions/commit-push-code
with:
commit-message: 'style: apply formatting'
test:
name: Run type checking & tests
runs-on: ubuntu-latest
needs: format
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }} - ${{ matrix.node-version }}'
cancel-in-progress: true
strategy:
matrix:
node-version: [22.x, 24.x]
steps:
- name: Checkout the Git repository
uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: ./.github/actions/setup-node
with:
node-version: ${{ matrix.node-version }}
- name: Install Node modules
uses: ./.github/actions/install-node-modules
- name: Run tests (Vitest)
uses: ./.github/actions/run-tests