Skip to content

Commit 2030007

Browse files
committed
Switch to bun
1 parent fc0e026 commit 2030007

4 files changed

Lines changed: 1623 additions & 10073 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15+
- uses: oven-sh/setup-bun@v2
1516
- name: Use Node.js 20
1617
uses: actions/setup-node@v4
1718
with:
1819
node-version: 20
1920

20-
# Re-use node_modules between runs until package-lock.json changes.
21+
# Re-use node_modules between runs until bun.lock changes.
2122
- name: Cache node_modules
2223
id: cache-node_modules
2324
uses: actions/cache@v4
2425
with:
2526
path: node_modules
26-
key: node_modules-${{ hashFiles('package-lock.json') }}
27+
key: node_modules-${{ hashFiles('bun.lock') }}
2728

2829
# Re-use ~/.elm between runs until elm.json or review/elm.json changes.
2930
# The Elm compiler saves downloaded Elm packages to ~/.elm saves
@@ -35,18 +36,18 @@ jobs:
3536
key: elm-${{ hashFiles('elm.json', 'review/elm.json') }}
3637

3738
# Install npm packages, unless we restored them from cache.
38-
# Since `npm ci` removes the node_modules folder before running it’s
39+
# Since `bun ci` removes the node_modules folder before running it’s
3940
# important to skip this step if cache was restored.
40-
- name: npm ci
41+
- name: bun ci
4142
if: steps.cache-node_modules.outputs.cache-hit != 'true'
42-
run: npm ci
43+
run: bun ci
4344

4445
- name: Format
45-
run: npm run format
46+
run: bun run format
4647
- name: Review
47-
run: npm run review
48+
run: bun run review
4849
- name: Test
49-
run: npm run test
50+
run: bun run test
5051

5152
diff-generation:
5253
permissions:
@@ -58,33 +59,34 @@ jobs:
5859
uses: actions/setup-node@v4
5960
with:
6061
node-version: 20
62+
- uses: oven-sh/setup-bun@v2
6163

6264
- name: Checkout branch
6365
uses: actions/checkout@v4
6466
with:
6567
path: branch
66-
68+
6769
- name: Checkout main
6870
uses: actions/checkout@v4
6971
with:
7072
ref: main
7173
path: main
7274

73-
# Re-use node_modules between runs until package-lock.json changes.
75+
# Re-use node_modules between runs until bun.lock changes.
7476
- name: Cache node_modules (branch)
7577
id: cache-node_modules-branch
7678
uses: actions/cache@v4
7779
with:
7880
path: branch/node_modules
79-
key: node_modules-${{ hashFiles('branch/package-lock.json') }}
81+
key: node_modules-${{ hashFiles('branch/bun.lock') }}
8082

81-
# Re-use node_modules between runs until package-lock.json changes.
83+
# Re-use node_modules between runs until bun.lock changes.
8284
- name: Cache node_modules (main)
8385
id: cache-node_modules-main
8486
uses: actions/cache@v4
8587
with:
8688
path: main/node_modules
87-
key: node_modules-${{ hashFiles('main/package-lock.json') }}
89+
key: node_modules-${{ hashFiles('main/bun.lock') }}
8890

8991
# Re-use ~/.elm between runs until elm.json or review/elm.json changes.
9092
# The Elm compiler saves downloaded Elm packages to ~/.elm saves
@@ -96,28 +98,28 @@ jobs:
9698
key: elm-${{ hashFiles('main/elm.json', 'main/review/elm.json', 'branch/elm.json', 'branch/review/elm.json') }}
9799

98100
# Install npm packages, unless we restored them from cache.
99-
# Since `npm ci` removes the node_modules folder before running it’s
101+
# Since `bun ci` removes the node_modules folder before running it’s
100102
# important to skip this step if cache was restored.
101-
- name: npm ci (branch)
103+
- name: bun ci (branch)
102104
if: steps.cache-node_modules-branch.outputs.cache-hit != 'true'
103105
working-directory: branch
104-
run: npm ci
106+
run: bun ci
105107

106108
# Install npm packages, unless we restored them from cache.
107-
# Since `npm ci` removes the node_modules folder before running it’s
109+
# Since `bun ci` removes the node_modules folder before running it’s
108110
# important to skip this step if cache was restored.
109-
- name: npm ci (main)
111+
- name: bun ci (main)
110112
if: steps.cache-node_modules-main.outputs.cache-hit != 'true'
111113
working-directory: main
112-
run: npm ci
113-
114+
run: bun ci
115+
114116
- name: Generate (branch)
115117
working-directory: branch
116-
run: npm run test:gen
117-
118+
run: bun run test:gen
119+
118120
- name: Generate (main)
119121
working-directory: main
120-
run: npm run test:gen || true # We don't want to block on main failing to generate
122+
run: bun run test:gen || true # We don't want to block on main failing to generate
121123

122124
- name: Diff the outputs
123125
run: |
@@ -131,4 +133,4 @@ jobs:
131133
uses: JoseThen/comment-pr@v1.2.0
132134
with:
133135
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134-
file_path: './diff.md'
136+
file_path: "./diff.md"

0 commit comments

Comments
 (0)