forked from lutinglt/gitea-github-theme
-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (105 loc) · 2.81 KB
/
Copy pathpull-request.yml
File metadata and controls
121 lines (105 loc) · 2.81 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
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
name: Pull Request
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review
branches:
- dev
pull_request_target:
types:
- opened
- edited
- reopened
- synchronize
- labeled
- unlabeled
- ready_for_review
branches:
- dev
concurrency:
group: pr-${{ github.event_name }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
require-release-label:
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
permissions:
issues: read
pull-requests: read
steps:
- name: Verify pull request release label
uses: mheap/github-action-required-labels@v5
with:
mode: exactly
count: 1
labels: "^(feature|change|bug|dependencies|skip-changelog)$"
use_regex: true
message: >-
Add one release label: feature, change, bug, dependencies, or skip-changelog. Add major as an optional
version modifier.
checks:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
check:
# - eslint
- prettier
- typescript
- vitest
- build
steps:
- uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: "1.4.0"
- uses: actions/cache@v6
with:
path: ~/.bun/install/cache
key: bun-cache-v3-${{ runner.os }}-${{ hashFiles('package.json') }}
- run: bun install --frozen-lockfile
# - name: Lint
# if: matrix.check == 'eslint'
# run: bun lint
- name: Format check
if: matrix.check == 'prettier'
run: bun fmt --check
- name: Type check
if: matrix.check == 'typescript'
run: bun check
- name: Test
if: matrix.check == 'vitest'
run: bun vitest --run
- name: Build
id: build
if: matrix.check == 'build'
run: bun bundle
- name: Upload css assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: themes
path: dist/*.css
- name: Upload templates assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: templates
path: templates
- name: Upload font assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: fonts
path: dist/assets/fonts
- name: Upload JavaScript assets
if: steps.build.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: scripts
path: dist/assets/js