-
Notifications
You must be signed in to change notification settings - Fork 190
62 lines (50 loc) · 1.71 KB
/
pr.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
name: Commitlint, Lint, Type Check, Test & Build
on:
workflow_call:
jobs:
static:
name: Static
runs-on: size-bertha
steps:
- name: Checkout
uses: actions/checkout@v3
- name: OpenJDK
uses: actions/setup-java@v3
with:
distribution: 'microsoft'
java-version: '11'
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Cache
uses: actions/cache@v3
with:
path: |
node_modules
~/.cache/Cypress
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Yarn Install
run: yarn install --immutable
# 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: yarn build:packages
- name: Lint
run: yarn lint
- name: Type Check
run: yarn type-check
- name: Add environment variables
run: yarn env app
- name: Test
run: yarn test:ci