Skip to content

Commit fd584f7

Browse files
igorcostaAutohand Evolve
andcommitted
Stabilize Bun dependency installs in CI
Pin the Tuistory test dependency to the known-good 0.4.0 release and require frozen Bun installs in CI and release workflows so prepare jobs use the committed lockfile instead of floating to broken transitive ranges. Co-authored-by: Autohand Evolve <code-noreply@autohand.ai>
1 parent a06f3bd commit fd584f7

4 files changed

Lines changed: 25 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: sudo apt-get update && sudo apt-get install -y build-essential python3 make g++
2929

3030
- name: Install dependencies
31-
run: bun install
31+
run: bun install --frozen-lockfile
3232

3333
- name: Type check
3434
run: bun run typecheck
@@ -58,7 +58,7 @@ jobs:
5858
run: sudo apt-get update && sudo apt-get install -y build-essential python3 make g++
5959

6060
- name: Install dependencies
61-
run: bun install
61+
run: bun install --frozen-lockfile
6262

6363
- name: Build
6464
run: bun run build

.github/workflows/release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
bun-version: 1.2.22
6868

6969
- name: Install dependencies
70-
run: bun install
70+
run: bun install --frozen-lockfile
7171

7272
- name: Get version
7373
id: version
@@ -117,7 +117,7 @@ jobs:
117117
bun-version: 1.2.22
118118

119119
- name: Install dependencies
120-
run: bun install
120+
run: bun install --frozen-lockfile
121121

122122
- name: Type check
123123
run: bun run typecheck
@@ -157,7 +157,7 @@ jobs:
157157
bun-version: 1.2.22
158158

159159
- name: Install dependencies
160-
run: bun install
160+
run: bun install --frozen-lockfile
161161

162162
- name: Update version before build
163163
run: |
@@ -557,7 +557,7 @@ jobs:
557557
- name: Build JS dist for npm
558558
if: needs.prepare.outputs.channel == 'release'
559559
run: |
560-
bun install
560+
bun install --frozen-lockfile
561561
bun run build
562562
ls -lh dist/
563563

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"strip-ansi": "^7.2.0",
9393
"tsup": "^8.5.1",
9494
"tsx": "^4.21.0",
95-
"tuistory": "^0.4.0",
95+
"tuistory": "0.4.0",
9696
"typescript": "^6.0.3",
9797
"vitest": "^4.1.5"
9898
},

tests/installLocalScript.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,21 @@ describe('local install scripts', () => {
4545
expect(installScript).not.toContain('bun run "compile:');
4646
});
4747
});
48+
49+
describe('dependency install guardrails', () => {
50+
it('pins tuistory because its patch releases can introduce broken transitive ranges', () => {
51+
const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) as {
52+
devDependencies?: Record<string, string>;
53+
};
54+
55+
expect(packageJson.devDependencies?.tuistory).toBe('0.4.0');
56+
});
57+
58+
it('uses the committed Bun lockfile in GitHub workflows', () => {
59+
for (const workflow of ['.github/workflows/ci.yml', '.github/workflows/release.yml']) {
60+
const content = readFileSync(workflow, 'utf8');
61+
62+
expect(content).not.toMatch(/\bbun install(?!\s+--frozen-lockfile)/);
63+
}
64+
});
65+
});

0 commit comments

Comments
 (0)