Compare commits

...

2 Commits

Author SHA1 Message Date
Jarred Sumner
d964212afb Update bun-windows.yml 2024-03-24 12:05:46 -07:00
Jarred Sumner
cf89deaeaa Do not skip tests in CI 2024-03-24 12:04:21 -07:00
10 changed files with 30 additions and 14 deletions

View File

@@ -4,6 +4,9 @@ concurrency:
group: bun-linux-build-${{ github.ref }}
cancel-in-progress: true
env:
BUN_CI: 1
on:
push:
branches:

View File

@@ -7,7 +7,7 @@ concurrency:
env:
LLVM_VERSION: 16
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
BUN_CI: 1
on:
push:
branches: [main]

View File

@@ -7,7 +7,7 @@ concurrency:
env:
LLVM_VERSION: 16
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
BUN_CI: 1
on:
push:
branches: [main]

View File

@@ -7,7 +7,7 @@ concurrency:
env:
LLVM_VERSION: 16
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
BUN_CI: 1
on:
push:
branches: [main]

View File

@@ -8,7 +8,7 @@ env:
# note: in other files, this version is only the major version, but for windows it is the full version
LLVM_VERSION: 16.0.6
BUN_DOWNLOAD_URL_BASE: https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/latest
BUN_CI: 1
tag: bun-windows
# TODO: wire this up to workflow_dispatch.
# github's expression syntax makes this hard to set a default to true

View File

@@ -12,7 +12,7 @@ on:
env:
ZIG_VERSION: 0.12.0-dev.1828+225fe6ddb
BUN_CI: 1
jobs:
format:
name: format

View File

@@ -9,6 +9,7 @@ export const isLinux = process.platform === "linux";
export const isPosix = isMacOS || isLinux;
export const isWindows = process.platform === "win32";
export const isIntelMacOS = isMacOS && process.arch === "x64";
export const isBunCI = process.env.BUN_CI === "1";
export const bunEnv: NodeJS.ProcessEnv = {
...process.env,
@@ -21,6 +22,8 @@ export const bunEnv: NodeJS.ProcessEnv = {
BUN_RUNTIME_TRANSPILER_CACHE_PATH: "0",
};
delete bunEnv.BUN_CI;
if (isWindows) {
bunEnv.SHELLOPTS = "igncr"; // Ignore carriage return
}
@@ -389,16 +392,24 @@ export async function describeWithContainer(
fn: (port: number) => void,
) {
describe(label, () => {
const docker = dockerExe();
if (!docker) {
test.skip(`docker is not installed, skipped: ${image}`, () => {});
return;
}
const { arch, platform } = process;
if ((archs && !archs?.includes(arch)) || platform === "win32") {
test.skip(`docker image is not supported on ${platform}/${arch}, skipped: ${image}`, () => {});
return false;
}
const docker = dockerExe();
if (!docker) {
if (isBunCI) {
test(label, () => {
throw new Error("Docker is not installed on CI but is required for this test");
});
return;
}
test.skip(`docker is not installed, skipped: ${image}`, () => {});
return;
}
let containerId: string;
{
const envs = Object.entries(env).map(([k, v]) => `-e${k}=${v}`);

View File

@@ -1,9 +1,10 @@
import { test, expect, describe } from "bun:test";
import { isBunCI } from "harness";
import { MongoClient } from "mongodb";
const CONNECTION_STRING = process.env.TLS_MONGODB_DATABASE_URL;
const it = CONNECTION_STRING ? test : test.skip;
const it = CONNECTION_STRING ? test : test.skipIf(!isBunCI);
describe("mongodb", () => {
it("should connect and inpect", async () => {

View File

@@ -1,8 +1,8 @@
import { test, expect, describe } from "bun:test";
import { bunRun } from "harness";
import { bunRun, isBunCI } from "harness";
import path from "path";
const it = process.env.SMTP_SENDGRID_KEY && process.env.SMTP_SENDGRID_SENDER ? test : test.skip;
const it = process.env.SMTP_SENDGRID_KEY && process.env.SMTP_SENDGRID_SENDER ? test : test.skipIf(!isBunCI);
describe("nodemailer", () => {
it("basic smtp", async () => {
try {

View File

@@ -1,11 +1,12 @@
import { test, expect, describe } from "bun:test";
import { isBunCI } from "harness";
import { Pool, Client } from "pg";
import { parse } from "pg-connection-string";
import postgres from "postgres";
const CONNECTION_STRING = process.env.TLS_POSTGRES_DATABASE_URL;
const it = CONNECTION_STRING ? test : test.skip;
const it = CONNECTION_STRING ? test : test.skipIf(!isBunCI);
describe("pg", () => {
it("should connect using TLS", async () => {