-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (55 loc) · 1.65 KB
/
Copy pathci.yml
File metadata and controls
70 lines (55 loc) · 1.65 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
name: CI
on:
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Lint
run: bun run lint
- name: Build
run: bun run build
- name: Type check
run: bun run typecheck
- name: Test
run: bun test
validate-plugins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Get modified plugins
id: changed-plugins
run: |
plugins=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- 'plugins/' | \
grep -oE 'plugins/[^/]+' | sort -u || true)
echo "plugins<<EOF" >> $GITHUB_OUTPUT
echo "$plugins" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Validate modified plugins
if: steps.changed-plugins.outputs.plugins != ''
run: |
failed=0
while IFS= read -r plugin_dir; do
[ -z "$plugin_dir" ] && continue
if [ -f "${plugin_dir}/plugin.json" ]; then
echo "Validating: $plugin_dir"
if ! bun cli/scripts/validate-plugin.ts "$plugin_dir"; then
failed=1
fi
fi
done <<< "${{ steps.changed-plugins.outputs.plugins }}"
exit $failed