Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

ci: pin the Bun toolchain across workflows

tianma-if2b9d568045b3
diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml
index c2d24571..990f3798 100644
--- a/.github/workflows/deploy-demo.yml
+++ b/.github/workflows/deploy-demo.yml
@@ -46,8 +46,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
diff --git a/.github/workflows/deploy-personal.yml b/.github/workflows/deploy-personal.yml
index 3631aeff..02423f3f 100644
--- a/.github/workflows/deploy-personal.yml
+++ b/.github/workflows/deploy-personal.yml
@@ -69,8 +69,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
diff --git a/.github/workflows/deploy-tools.yml b/.github/workflows/deploy-tools.yml
index 1da9089d..72e35600 100644
--- a/.github/workflows/deploy-tools.yml
+++ b/.github/workflows/deploy-tools.yml
@@ -54,8 +54,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- name: Install dependencies
run: bun install --frozen-lockfile
diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml
index 555b5b4f..476780fa 100644
--- a/.github/workflows/desktop-build.yml
+++ b/.github/workflows/desktop-build.yml
@@ -173,8 +173,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: 1.3.14
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
@@ -359,8 +357,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: 1.3.14
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
diff --git a/.github/workflows/mobile-build.yml b/.github/workflows/mobile-build.yml
index 7c75dc4e..eba55d3d 100644
--- a/.github/workflows/mobile-build.yml
+++ b/.github/workflows/mobile-build.yml
@@ -66,8 +66,6 @@ jobs:
- name: Set up Bun for release validation
uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- name: Install release validation dependencies
run: bun install --frozen-lockfile
diff --git a/.github/workflows/play-generated-apk-audit.yml b/.github/workflows/play-generated-apk-audit.yml
index 5bab6682..da6abb65 100644
--- a/.github/workflows/play-generated-apk-audit.yml
+++ b/.github/workflows/play-generated-apk-audit.yml
@@ -20,8 +20,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: 1.3.14
- name: Install dependencies
run: bun install --frozen-lockfile
diff --git a/.github/workflows/store-delivery.yml b/.github/workflows/store-delivery.yml
index 14d159b5..b5d298a9 100644
--- a/.github/workflows/store-delivery.yml
+++ b/.github/workflows/store-delivery.yml
@@ -153,8 +153,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: 1.3.14
- name: Set up EAS CLI
if: ${{ !inputs.recover_play_apk }}
@@ -282,8 +280,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- with:
- bun-version: 1.3.14
- name: Set up EAS CLI
uses: expo/expo-github-action@v8
diff --git a/.github/workflows/sync-edgeever-upstream.yml b/.github/workflows/sync-edgeever-upstream.yml
index 15bc1340..65b9e1b6 100644
--- a/.github/workflows/sync-edgeever-upstream.yml
+++ b/.github/workflows/sync-edgeever-upstream.yml
@@ -238,8 +238,6 @@ jobs:
- name: Set up Bun
if: steps.upstream.outputs.align_mode == 'merge'
uses: oven-sh/setup-bun@v2
- with:
- bun-version: latest
- name: Verify customized merge
if: steps.upstream.outputs.align_mode == 'merge'
diff --git a/.github/workflows/windows-test-signing.yml b/.github/workflows/windows-test-signing.yml
index 93cf2522..a0ebf24e 100644
--- a/.github/workflows/windows-test-signing.yml
+++ b/.github/workflows/windows-test-signing.yml
@@ -19,8 +19,6 @@ jobs:
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- with:
- bun-version: 1.3.14
- name: Set up Rust
uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable
diff --git a/package.json b/package.json
index 2eeeee99..beb61d80 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,7 @@
{
"name": "edgeever",
"version": "1.58.1",
+ "packageManager": "[email protected]",
"private": true,
"type": "module",
"workspaces": [
@@ -8,7 +9,7 @@
"packages/*"
],
"scripts": {
- "test": "bun test --timeout 15000 --path-ignore-patterns='tests/e2e/**'",
+ "test": "bun test --path-ignore-patterns='tests/e2e/**'",
"dev": "bun run dev:local",
"dev:api": "bun run dev:api:local",
"dev:local": "bun scripts/local-dev.mjs start local",
diff --git a/tests/bun-toolchain-version.test.ts b/tests/bun-toolchain-version.test.ts
new file mode 100644
index 00000000..dcf9abe5
--- /dev/null
+++ b/tests/bun-toolchain-version.test.ts
@@ -0,0 +1,32 @@
+import { readFileSync, readdirSync } from "node:fs";
+import { resolve } from "node:path";
+import { describe, expect, test } from "bun:test";
+
+const repositoryRoot = resolve(import.meta.dir, "..");
+const readRepositoryFile = (path: string) => readFileSync(resolve(repositoryRoot, path), "utf8");
+const packageJson = JSON.parse(readRepositoryFile("package.json")) as { packageManager?: string };
+const bunVersion = packageJson.packageManager?.match(/^bun@(.+)$/)?.[1];
+
+describe("Bun toolchain version", () => {
+ test("pins one repository-wide Bun version", () => {
+ expect(bunVersion).toBe("1.3.14");
+ });
+
+ test("all GitHub Actions inherit the repository version", () => {
+ const workflowDirectory = resolve(repositoryRoot, ".github/workflows");
+ const workflows = readdirSync(workflowDirectory)
+ .filter((name) => name.endsWith(".yml") || name.endsWith(".yaml"))
+ .map((name) => [name, readFileSync(resolve(workflowDirectory, name), "utf8")] as const)
+ .filter(([, content]) => content.includes("oven-sh/setup-bun@"));
+
+ expect(workflows.length).toBeGreaterThan(0);
+ for (const [name, content] of workflows) {
+ expect(content, `${name} must let setup-bun read packageManager`).not.toContain("bun-version:");
+ }
+ });
+
+ test("container entrypoints stay on the repository version", () => {
+ expect(readRepositoryFile("Dockerfile")).toContain(`FROM oven/bun:${bunVersion}-alpine AS runtime`);
+ expect(readRepositoryFile("scripts/publish-tcr-image.sh")).toContain(`oven/bun:${bunVersion}-alpine`);
+ });
+});
diff --git a/tests/deployment-entrypoints.test.ts b/tests/deployment-entrypoints.test.ts
index da9c99ba..0efb497d 100644
--- a/tests/deployment-entrypoints.test.ts
+++ b/tests/deployment-entrypoints.test.ts
@@ -456,9 +456,7 @@ describe("Cloudflare deployment entrypoints", () => {
expect(workflow).not.toContain("force_redeploy:");
expect(workflow).toContain("bun run db:migrate:local");
expect(bunConfig).toContain('pathIgnorePatterns = ["tests/e2e/**"]');
- expect(scripts.test).toBe(
- "bun test --timeout 15000 --path-ignore-patterns='tests/e2e/**'",
- );
+ expect(scripts.test).toBe("bun test --path-ignore-patterns='tests/e2e/**'");
expect(workflow).toContain("bun run test");
expect(workflow.match(/if: steps\.upstream\.outputs\.align_mode == 'merge'/g)).toHaveLength(2);
expect(workflow).toContain("git push origin HEAD:main");