Skip to content

Commit 35889ff

Browse files
committed
fix ci and use composite actions
1 parent 2cef37c commit 35889ff

File tree

7 files changed

+87
-43
lines changed

7 files changed

+87
-43
lines changed

.github/actions/setup/action.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Setup
2+
description: Checkout code, init submodules, link modules, and install dependencies
3+
4+
inputs:
5+
fetch-depth:
6+
description: Git fetch depth (0 = full history)
7+
required: false
8+
default: '1'
9+
10+
bun-version:
11+
description: Bun version to use
12+
required: false
13+
default: latest
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: ${{ inputs.fetch-depth }}
22+
submodules: recursive
23+
24+
- name: Setup Bun
25+
uses: oven-sh/setup-bun@v2
26+
with:
27+
bun-version: ${{ inputs.bun-version }}
28+
29+
- name: Link submodules
30+
shell: bash
31+
run: |
32+
for dir in modules/*/; do
33+
(cd "$dir" && bun link)
34+
done
35+
36+
- name: Install dependencies
37+
shell: bash
38+
run: bun install --frozen-lockfile

.github/workflows/pre-commit.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,8 @@ jobs:
99
name: Pre-commit Checks
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v5
14-
with:
15-
fetch-depth: 0
16-
17-
- name: Setup Bun
18-
uses: oven-sh/setup-bun@v2
19-
with:
20-
bun-version: latest
21-
22-
- name: Install dependencies
23-
run: bun install --frozen-lockfile
12+
- name: Setup
13+
uses: ./.github/actions/setup
2414

2515
- name: Type (TypeScript)
2616
id: type

.github/workflows/publish.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
name: Publish
1+
name: publish
22

33
on:
44
push:
5-
branches:
6-
- main
75
tags:
86
- 'v*'
97

@@ -67,18 +65,8 @@ jobs:
6765
needs: checks
6866
runs-on: ubuntu-latest
6967
steps:
70-
- name: Checkout code
71-
uses: actions/checkout@v5
72-
with:
73-
fetch-depth: 0
74-
75-
- name: Setup Bun
76-
uses: oven-sh/setup-bun@v2
77-
with:
78-
bun-version: latest
79-
80-
- name: Install dependencies
81-
run: bun install --frozen-lockfile
68+
- name: Setup
69+
uses: ./.github/actions/setup
8270

8371
- name: Build
8472
run: bun run build
@@ -90,7 +78,7 @@ jobs:
9078
path: dist/
9179

9280
approve:
93-
name: Approve Publishing
81+
name: Approval
9482
needs: [checks, build]
9583
runs-on: ubuntu-latest
9684
environment: npm-publish
@@ -99,7 +87,7 @@ jobs:
9987
run: echo "Publish approved"
10088

10189
publish:
102-
name: Publish to npm
90+
name: Publish
10391
needs: approve
10492
runs-on: ubuntu-latest
10593
permissions:

.github/workflows/tests.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,8 @@ jobs:
1111
name: Tests
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v5
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Setup Bun
20-
uses: oven-sh/setup-bun@v2
21-
with:
22-
bun-version: latest
23-
24-
- name: Install dependencies
25-
run: bun install
14+
- name: Setup
15+
uses: ./.github/actions/setup
2616

2717
- name: Run tests
2818
run: bun test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# dependencies (bun install)
1+
# dependencies
22
node_modules
33

44
# output

bun.lock

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"eslint": "^9.39.3",
3333
"prettier": "^3.8.1",
3434
"prettier-plugin-organize-imports": "^4.3.0",
35-
"typescript": "^5.9.3"
35+
"typescript": "^5.9.3",
36+
"typescript-eslint": "^8.56.1"
3637
},
3738
"peerDependencies": {
3839
"vite": "^7.3.1"

0 commit comments

Comments
 (0)