ci: pin the Bun toolchain across workflows
This commit is contained in:
1 parent
09b8b14668
commit
2b9d568045
12 files changed
+35
-26
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"name": "edgeever",
|
||||
"version": "1.58.1",
|
||||
"packageManager": "bun@1.3.14",
|
||||
"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",
|
||||
|
||||
@@ -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`);
|
||||
});
|
||||
});
|
||||
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user