-
Notifications
You must be signed in to change notification settings - Fork 200
60 lines (48 loc) · 1.74 KB
/
pr.yml
File metadata and controls
60 lines (48 loc) · 1.74 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
name: Commitlint, Lint, Type Check, Test & Build
on:
workflow_call:
jobs:
static:
name: Static
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: OpenJDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '11'
- name: Setup pnpm
run: corepack enable && corepack prepare [email protected] --activate
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-modules-
- name: Install Dependencies
run: pnpm install --frozen-lockfile
# needs to run after install
- name: Commitlint PR Title
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-contexts
# only commitlint on PRs - pull_request.title not available in merge_group (merge queue)
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#merge_group
# once a PR is in the merge queue, its title has already been commitlint'd
if: ${{ github.event_name == 'pull_request' }}
env:
TITLE: ${{ github.event.pull_request.title }}
run: printf '%s' "$TITLE" | npx commitlint
- name: Build Packages
run: pnpm run build:packages
- name: Lint
run: pnpm run lint
- name: Type Check
run: pnpm run type-check
- name: Test
run: pnpm run test