-
Notifications
You must be signed in to change notification settings - Fork 1.4k
141 lines (117 loc) · 3.24 KB
/
pr_checks.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Checks
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
permissions:
pull-requests: write
concurrency:
# Support push/pr as event types with different behaviors each:
# 1. push: queue up builds
# 2. pr: only allow one run per PR
group: ${{ github.workflow }}-${{ github.event.type }}${{ github.event.pull_request.number }}
# If there is already a workflow running for the same pull request, cancel it
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
code_style:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
strategy:
matrix:
style-command:
- lint
- prettier
- typecheck
- build:sample-apps
- danger
steps:
- name: checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- name: install
run: pnpm install
- name: build
run: pnpm build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
- name: check
run: pnpm ${{ matrix.style-command }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
bundle_size:
runs-on: ubuntu-latest
name: Bundle size check
permissions:
contents: write
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- name: install
run: pnpm install
- name: build
run: pnpm build
- name: Running vite-size script
uses: glitch-txs/vite-size-action@v1.0.3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
test:
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: write
pull-requests: write
steps:
- name: checkout
uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'pnpm'
- name: install
run: pnpm install
- name: build
run: pnpm build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
- name: Test
run: pnpm test
- name: Merge Coverage Reports
if: always()
run: pnpm coverage:merge
- name: Report
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
name: Coverage
json-final-path: ./coverage/coverage-merged-final.json
json-summary-path: ./coverage/coverage-merged-summary.json
ui-test:
if: github.event.pull_request.draft == false
uses: ./.github/workflows/ui_tests.yml
secrets: inherit
permissions:
contents: write
pull-requests: write
with:
branch: ${{ github.ref }}