-
-
Notifications
You must be signed in to change notification settings - Fork 229
220 lines (182 loc) Β· 5.65 KB
/
quality_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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Quality checks ππ§ͺ
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- "**/*.md"
schedule:
- cron: "30 7 * * 6"
workflow_dispatch:
jobs:
dependency-review:
name: Vulnerable dependencies π
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Scan
uses: actions/[email protected]
lint:
name: Lint π¬
runs-on: ubuntu-latest
steps:
- name: Checkout β¬οΈ
uses: actions/[email protected]
- name: Setup node environment βοΈ
uses: actions/[email protected]
with:
node-version: 18
check-latest: true
- name: Install dependencies π¦
run: npm ci --no-audit
- name: Run linter βοΈ
run: npm run lint
typecheck:
name: Typecheck π―
runs-on: ubuntu-latest
steps:
- name: Checkout β¬οΈ
uses: actions/[email protected]
- name: Setup node environment βοΈ
uses: actions/[email protected]
with:
node-version: 18
check-latest: true
- name: Install dependencies π¦
run: npm ci --no-audit
- name: Run typecheck π
run: npm run typecheck
build:
name: Build frontend π οΈ
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- "linux/amd64"
- "linux/arm64"
- "linux/arm"
steps:
- name: Checkout β¬οΈ
uses: actions/[email protected]
- name: Configure QEMU βοΈ
uses: docker/[email protected]
- name: Configure Docker Buildx βοΈ
uses: docker/[email protected]
- name: Build Docker images π οΈ
uses: docker/[email protected]
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
tags: |
jellyfin/jellyfin-vue:pr-build
- name: Extract built client and Docker image for artifact publishing π¦
if: ${{ matrix.platform == 'linux/amd64' }}
run: |
docker save jellyfin/jellyfin-vue:pr-build > docker_image.tar
docker cp $(docker create --name jf jellyfin/jellyfin-vue:pr-build):/usr/share/nginx/html/ ./dist
docker rm jf
- name: Upload artifact (Docker image) β¬οΈπ¦
uses: actions/[email protected]
if: ${{ matrix.platform == 'linux/amd64' }}
with:
name: docker_image
path: |
docker_image.tar
- name: Upload artifact (Client) β¬οΈπ»
uses: actions/[email protected]
if: ${{ matrix.platform == 'linux/amd64' }}
with:
name: frontend
path: |
dist
build_tauri:
name: Build Tauri π οΈ
strategy:
fail-fast: false
matrix:
platform:
- "macos-latest"
- "ubuntu-latest"
- "windows-latest"
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout β¬οΈ
uses: actions/[email protected]
- name: Setup node environment βοΈ
uses: actions/[email protected]
with:
node-version: 18
check-latest: true
- name: Install dependencies π¦
run: npm ci --no-audit -w tauri
- name: Install webkit2gtk (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y webkit2gtk-4.0
- name: Generate Tauri icons ποΈ
run: "npm run tauri:icon -w tauri"
- name: Build Tauri π οΈ
run: "npm run tauri:build -w tauri"
- name: Upload artifact (Linux) β¬οΈπ§
uses: actions/[email protected]
if: matrix.platform == 'ubuntu-latest'
with:
name: jellyfin-vue_linux-amd64
path: |
tauri/target/release/bundle/deb/*.deb
tauri/target/release/bundle/appimage_deb
- name: Upload artifact (MacOS) β¬οΈπ
uses: actions/[email protected]
if: matrix.platform == 'macos-latest'
with:
name: jellyfin-vue_macOS
path: |
tauri/target/release/bundle/macos
tauri/target/release/bundle/dmg/*.dmg
- name: Upload artifact (Windows) β¬οΈπͺ
uses: actions/[email protected]
if: matrix.platform == 'windows-latest'
with:
name: jellyfin-vue_windows_amd64
path: tauri/target/release/jellyfin-vue.exe
pr_context:
name: Save PR context as artifact
if: ${{ always() && !cancelled() && github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
needs:
- dependency-review
- lint
- typecheck
- build
- build_tauri
steps:
- name: Save PR context
env:
PR_NUMBER: ${{ github.event.number }}
PR_SHA: ${{ github.sha }}
run: |
echo $PR_NUMBER > PR_number
echo $PR_SHA > PR_sha
- name: Upload PR number as artifact
uses: actions/[email protected]
with:
name: PR_context
path: |
PR_number
PR_sha
conventional_commits:
name: Conventional commits check π¬
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Checkout β¬οΈ
uses: actions/[email protected]
- name: Check if all commits comply with the specification
uses: webiny/[email protected]