Skip to content

Commit d2c4995

Browse files
chore(turbo): more build caching (#1667)
* chore(turbo): more build caching * chore: turbo build release * chore(turbo): add cache to more workflows
1 parent 9e1d463 commit d2c4995

File tree

7 files changed

+40
-10
lines changed

7 files changed

+40
-10
lines changed

.github/workflows/autofix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131
with:
3232
node-version-file: .tool-versions
3333
- run: yarn install
34+
- run: yarn lint:fix --cache-strategy content
3435
- run: yarn format:fix
35-
- run: yarn lint:fix
3636
- name: Apply fixes
3737
uses: autofix-ci/action@v1
3838
with:

.github/workflows/ci-bun-transpiler.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ jobs:
1818
with:
1919
bun-version-file: .tool-versions
2020
- run: yarn workspaces focus hono-middleware @hono/bun-transpiler
21-
- run: yarn workspace @hono/bun-transpiler build
22-
- run: yarn workspace @hono/bun-transpiler typecheck
23-
- run: yarn eslint packages/bun-transpiler
24-
- run: yarn prettier --check . !packages packages/bun-transpiler
21+
- run: yarn turbo --filter @hono/bun-transpiler build
2522
- run: yarn workspace @hono/bun-transpiler test --coverage --coverage-reporter lcov
2623
- uses: codecov/codecov-action@v5
2724
with:

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ jobs:
5656

5757
steps:
5858
- uses: actions/checkout@v6
59+
- uses: actions/cache@v5
60+
with:
61+
path: .turbo
62+
key: ${{ runner.os }}-turbo-${{ github.sha }}
63+
restore-keys: |
64+
${{ runner.os }}-turbo-
5965
- uses: actions/setup-node@v6
6066
with:
6167
node-version-file: .tool-versions
6268
- run: yarn workspaces focus hono-middleware @hono/${{ matrix.package }}
63-
- run: yarn workspaces foreach --topological --recursive --from @hono/${{ matrix.package }} run build
69+
- run: yarn turbo --filter @hono/${{ matrix.package }} build
6470
- run: yarn test --coverage --project @hono/${{ matrix.package }}
6571
id: test
6672
if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }}

.github/workflows/cr.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020
with:
2121
fetch-depth: 0
2222

23+
- uses: actions/cache@v5
24+
with:
25+
path: .turbo
26+
key: ${{ runner.os }}-turbo-preview-${{ github.sha }}
27+
restore-keys: |
28+
${{ runner.os }}-turbo-preview-
29+
${{ runner.os }}-turbo-
30+
2331
- uses: actions/setup-node@v6
2432
with:
2533
node-version-file: .tool-versions
@@ -28,7 +36,7 @@ jobs:
2836
run: yarn
2937

3038
- name: Build
31-
run: yarn build
39+
run: yarn turbo build
3240

3341
- name: Publish to StackBlitz
3442
run: yarn pkg-pr-new publish --compact --no-template './packages/*'

.github/workflows/pr.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version-file: .tool-versions
4343
- run: yarn
4444
- run: yarn typecheck
45-
- run: yarn lint
45+
- run: yarn lint --cache-strategy content
4646
- run: yarn format
4747

4848
dry-run:
@@ -66,11 +66,17 @@ jobs:
6666

6767
steps:
6868
- uses: actions/checkout@v6
69+
- uses: actions/cache@v5
70+
with:
71+
path: .turbo
72+
key: ${{ runner.os }}-turbo-${{ github.sha }}
73+
restore-keys: |
74+
${{ runner.os }}-turbo-
6975
- uses: actions/setup-node@v6
7076
with:
7177
node-version-file: .tool-versions
7278
- run: yarn workspaces focus hono-middleware @hono/${{ matrix.package }}
73-
- run: yarn workspaces foreach --topological --recursive --from @hono/${{ matrix.package }} run build
79+
- run: yarn turbo --filter @hono/${{ matrix.package }} build
7480
- run: yarn test --coverage --project @hono/${{ matrix.package }}
7581
id: test
7682
if: ${{ matrix.package != 'eslint-config' && matrix.package != 'qwik-city' && matrix.package != 'react-compat' }}

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ jobs:
1919
- name: Checkout Repo
2020
uses: actions/checkout@v6
2121

22+
- name: Build Cache
23+
uses: actions/cache@v5
24+
with:
25+
path: .turbo
26+
key: ${{ runner.os }}-turbo-release-${{ github.sha }}
27+
restore-keys: |
28+
${{ runner.os }}-turbo-release-
29+
${{ runner.os }}-turbo-
30+
2231
- name: Setup Node.js 20.x
2332
uses: actions/setup-node@v6
2433
with:
@@ -32,7 +41,7 @@ jobs:
3241
run: yarn
3342

3443
- name: Build
35-
run: yarn build
44+
run: yarn turbo build
3645

3746
- name: Create Release Pull Request or Publish to npm
3847
id: changesets

turbo.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"$schema": "https://turborepo.com/schema.json",
33
"tasks": {
4+
"build": {
5+
"dependsOn": ["^build"],
6+
"outputs": ["dist/**"]
7+
},
48
"format": {
59
"outputs": [".cache/.prettiercache"],
610
"outputLogs": "new-only"

0 commit comments

Comments
 (0)