GeezerVison is showing github.com — ci: centralize bun setup to reduce duplication and improve caching · karnagge/codechico@32b97a5
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboard +20Lines changed: 20 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: "Setup Bun" |
| 2 | +description: "Setup Bun with caching and install dependencies" |
| 3 | +runs: |
| 4 | + using: "composite" |
| 5 | + steps: |
| 6 | + - name: Setup Bun |
| 7 | + uses: oven-sh/setup-bun@v2 |
| 8 | + |
| 9 | + - name: Cache ~/.bun |
| 10 | + id: cache-bun |
| 11 | + uses: actions/cache@v4 |
| 12 | + with: |
| 13 | + path: ~/.bun |
| 14 | + key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb', 'bun.lock') }} |
| 15 | + restore-keys: | |
| 16 | + ${{ runner.os }}-bun- |
| 17 | +
|
| 18 | + - name: Install dependencies |
| 19 | + run: bun install |
| 20 | + shell: bash |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml +1-5Lines changed: 1 addition & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
15 | 15 | steps: |
16 | 16 | - uses: actions/checkout@v3 |
17 | 17 |
|
18 | | - - uses: oven-sh/setup-bun@v1 |
19 | | - with: |
20 | | - bun-version: 1.3.0 |
21 | | - |
22 | | - - run: bun install |
| 18 | + - uses: ./.github/actions/setup-bun |
23 | 19 |
|
24 | 20 | - run: bun sst deploy --stage=${{ github.ref_name }} |
25 | 21 | env: |
|
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/format.yml +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,13 +20,10 @@ jobs: |
20 | 20 | token: ${{ secrets.GITHUB_TOKEN }} |
21 | 21 |
|
22 | 22 | - name: Setup Bun |
23 | | - uses: oven-sh/setup-bun@v1 |
24 | | - with: |
25 | | - bun-version: 1.3.0 |
| 23 | + uses: ./.github/actions/setup-bun |
26 | 24 |
|
27 | 25 | - name: run |
28 | 26 | run: | |
29 | | - bun install |
30 | 27 | ./script/format.ts |
31 | 28 | env: |
32 | 29 | CI: true |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/publish-vscode.yml +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -19,16 +19,13 @@ jobs: |
19 | 19 | with: |
20 | 20 | fetch-depth: 0 |
21 | 21 |
|
22 | | - - uses: oven-sh/setup-bun@v2 |
23 | | - with: |
24 | | - bun-version: 1.3.0 |
| 22 | + - uses: ./.github/actions/setup-bun |
25 | 23 |
|
26 | 24 | - run: git fetch --force --tags |
27 | 25 | - run: bun install -g @vscode/vsce |
28 | 26 |
|
29 | 27 | - name: Publish |
30 | 28 | run: | |
31 | | - bun install |
32 | 29 | ./script/publish |
33 | 30 | working-directory: ./sdks/vscode |
34 | 31 | env: |
|
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +1-14Lines changed: 1 addition & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
35 | 35 | cache: true |
36 | 36 | cache-dependency-path: go.sum |
37 | 37 |
|
38 | | - - uses: oven-sh/setup-bun@v2 |
39 | | - with: |
40 | | - bun-version: 1.3.0 |
41 | | - |
42 | | - - name: Cache ~/.bun |
43 | | - id: cache-bun |
44 | | - uses: actions/cache@v3 |
45 | | - with: |
46 | | - path: ~/.bun |
47 | | - key: ${{ runner.os }}-bun-1-3-0-${{ hashFiles('bun.lock') }} |
48 | | - restore-keys: | |
49 | | - ${{ runner.os }}-bun-1-3-0- |
| 38 | + - uses: ./.github/actions/setup-bun |
50 | 39 |
|
51 | 40 | - name: Install makepkg |
52 | 41 | run: | |
|
60 | 49 | |
61 | 50 | git config --global user.name "opencode" |
62 | 51 | ssh-keyscan -H aur.archlinux.org >> ~/.ssh/known_hosts || true |
63 | | - - name: Install dependencies |
64 | | - run: bun install |
65 | 52 |
|
66 | 53 | - name: Install OpenCode |
67 | 54 | run: curl -fsSL https://opencode.ai/install | bash |
|
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/snapshot.yml +1-15Lines changed: 1 addition & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
24 | 24 | cache: true |
25 | 25 | cache-dependency-path: go.sum |
26 | 26 |
|
27 | | - - uses: oven-sh/setup-bun@v2 |
28 | | - with: |
29 | | - bun-version: 1.3.0 |
30 | | - |
31 | | - - name: Cache ~/.bun |
32 | | - id: cache-bun |
33 | | - uses: actions/cache@v3 |
34 | | - with: |
35 | | - path: ~/.bun |
36 | | - key: ${{ runner.os }}-bun-1-3-0-${{ hashFiles('bun.lock') }} |
37 | | - restore-keys: | |
38 | | - ${{ runner.os }}-bun-1-3-0- |
39 | | -
|
40 | | - - name: Install dependencies |
41 | | - run: bun install |
| 27 | + - uses: ./.github/actions/setup-bun |
42 | 28 |
|
43 | 29 | - name: Publish |
44 | 30 | run: | |
|
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/stats.yml +1-3Lines changed: 1 addition & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
16 | 16 | uses: actions/checkout@v4 |
17 | 17 |
|
18 | 18 | - name: Setup Bun |
19 | | - uses: oven-sh/setup-bun@v2 |
20 | | - with: |
21 | | - bun-version: latest |
| 19 | + uses: ./.github/actions/setup-bun |
22 | 20 |
|
23 | 21 | - name: Run stats script |
24 | 22 | run: bun script/stats.ts |
|
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/test.yml +1-4Lines changed: 1 addition & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -18,15 +18,12 @@ jobs: |
18 | 18 | token: ${{ secrets.GITHUB_TOKEN }} |
19 | 19 |
|
20 | 20 | - name: Setup Bun |
21 | | - uses: oven-sh/setup-bun@v1 |
22 | | - with: |
23 | | - bun-version: 1.3.0 |
| 21 | + uses: ./.github/actions/setup-bun |
24 | 22 |
|
25 | 23 | - name: run |
26 | 24 | run: | |
27 | 25 | |
28 | 26 | git config --global user.name "opencode" |
29 | | - bun install |
30 | 27 | bun turbo test |
31 | 28 | env: |
32 | 29 | CI: true |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/typecheck.yml +1-6Lines changed: 1 addition & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
13 | 13 | uses: actions/checkout@v4 |
14 | 14 |
|
15 | 15 | - name: Setup Bun |
16 | | - uses: oven-sh/setup-bun@v1 |
17 | | - with: |
18 | | - bun-version: 1.3.0 |
19 | | - |
20 | | - - name: Install dependencies |
21 | | - run: bun install |
| 16 | + uses: ./.github/actions/setup-bun |
22 | 17 |
|
23 | 18 | - name: Run typecheck |
24 | 19 | run: bun typecheck |