forked from assistant-ui/assistant-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (116 loc) · 3.45 KB
/
code-quality.yaml
File metadata and controls
135 lines (116 loc) · 3.45 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Code Quality
on:
push:
branches: [main]
paths:
- "packages/**"
- "apps/**"
- "examples/**"
- "turbo.json"
- "package.json"
- "pnpm-lock.yaml"
- ".github/workflows/code-quality.yaml"
pull_request:
branches: [main]
paths:
- "packages/**"
- "apps/**"
- "examples/**"
- "turbo.json"
- "package.json"
- "pnpm-lock.yaml"
- ".github/workflows/code-quality.yaml"
permissions:
contents: read
jobs:
lint:
name: Biome
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 5
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run Biome
run: pnpm lint
build:
name: Build Changed Packages
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.ref }}-
${{ runner.os }}-turbo-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build packages
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
# PR: Build packages changed compared to base branch
pnpm turbo build --filter="...[origin/${{ github.base_ref }}]"
else
# Push to main: Build packages changed in last commit
pnpm turbo build --filter="...[HEAD^1]"
fi
test:
name: Test Changed Packages
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 5
# Note: No dependency on 'build' job - Turbo handles test->build dependencies internally via dependsOn
steps:
- name: Checkout code repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup node.js
uses: actions/setup-node@v6
with:
node-version: 24
cache: "pnpm"
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.ref }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-${{ github.ref }}-
${{ runner.os }}-turbo-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
# PR: Test packages changed compared to base branch
pnpm turbo test --filter="...[origin/${{ github.base_ref }}]"
else
# Push to main: Test packages changed in last commit
pnpm turbo test --filter="...[HEAD^1]"
fi