-
Notifications
You must be signed in to change notification settings - Fork 125
57 lines (46 loc) · 1.36 KB
/
on-pull-request.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
name: Run checks on Pull Requests
on:
pull_request:
jobs:
# admins are still able to override this check if we need to merge something ASAP
check_branch:
name: "Enforce development branch"
runs-on: ubuntu-latest
steps:
- name: Check branch
if: github.base_ref == 'main' && github.head_ref != 'development'
run: |
echo "ERROR: You can only merge to main from development."
exit 1
enforce_title:
name: Enforce PR Title Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.16"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Use commitlint to check PR title
run: echo "${{ github.event.pull_request.title }}" | yarn commitlint
build_and_lint_and_test:
name: Lint and Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "18.16"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint:check
- name: Build
run: yarn build
- name: Unit Test
run: yarn test