Skip to content

Commit

Permalink
ci: set up tests
Browse files Browse the repository at this point in the history
update ci

update ci
  • Loading branch information
tsirysndr committed Mar 5, 2024
1 parent 9162966 commit ad1bcb1
Show file tree
Hide file tree
Showing 32 changed files with 9,349 additions and 548 deletions.
424 changes: 181 additions & 243 deletions .fluentci/deno.lock

Large diffs are not rendered by default.

65 changes: 35 additions & 30 deletions .fluentci/deps.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
export { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
import Client from "https://sdk.fluentci.io/v0.2.0/mod.ts";
export default Client;
export { assertEquals } from "jsr:@std/[email protected]/asserts";

export {
connect,
uploadContext,
CacheSharingMode,
Container,
} from "https://sdk.fluentci.io/v0.2.0/mod.ts";
export { brightGreen } from "https://deno.land/[email protected]/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.2/src/dagger/steps.ts";
export { stringifyTree } from "https://esm.sh/[email protected]";
import gql from "https://esm.sh/[email protected]";
export type { DirectoryID, SecretID } from "./sdk/client.gen.ts";
export { File, Directory, Secret, dag } from "./sdk/client.gen.ts";
export { brightGreen } from "jsr:@std/[email protected]/colors";
export { stringifyTree } from "npm:[email protected]";
import { gql } from "npm:[email protected]";
export { gql };
export { dirname, join, resolve } from "jsr:@std/[email protected]";
export { parse } from "jsr:@std/[email protected]";

import * as _ from "npm:[email protected]";
const snakeCase = _.default.snakeCase;
const camelCase = _.default.camelCase;
export { snakeCase, camelCase };

import * as env from "jsr:@tsirysndr/[email protected]";
export { env };

export { ClientError, GraphQLClient } from "npm:[email protected]";
export {
arg,
queryType,
stringArg,
intArg,
nonNull,
makeSchema,
} from "npm:nexus";
export {
dirname,
join,
resolve,
} from "https://deno.land/[email protected]/path/mod.ts";
DaggerSDKError,
UnknownDaggerError,
DockerImageRefValidationError,
EngineSessionConnectParamsParseError,
ExecError,
GraphQLRequestError,
InitEngineSessionBinaryError,
TooManyNestedObjectsError,
EngineSessionError,
EngineSessionConnectionTimeoutError,
NotAwaitedRequestError,
ERROR_CODES,
} from "./sdk/common/errors/index.ts";

export * as FluentGitlabCI from "https://deno.land/x/[email protected]/mod.ts";
export * as FluentGithubActions from "https://deno.land/x/[email protected]/mod.ts";
export * as FluentCircleCI from "https://deno.land/x/[email protected]/mod.ts";
export * as FluentAzurePipelines from "https://deno.land/x/[email protected]/mod.ts";
export * as FluentAWSCodePipeline from "https://deno.land/x/[email protected]/mod.ts";
export * as FluentGitlabCI from "jsr:@tsirysndr/[email protected]";
export * as FluentGithubActions from "jsr:@tsirysndr/[email protected]";
export * as FluentCircleCI from "jsr:@tsirysndr/[email protected]";
export * as FluentAzurePipelines from "jsr:@tsirysndr/[email protected]";
export * as FluentAWSCodePipeline from "jsr:@tsirysndr/[email protected]";
139 changes: 0 additions & 139 deletions .fluentci/gen/nexus.ts

This file was deleted.

2 changes: 0 additions & 2 deletions .fluentci/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
export * from "./src/dagger/index.ts";
export * as queries from "./src/dagger/queries.ts";
export { schema } from "./src/dagger/schema.ts";
8 changes: 0 additions & 8 deletions .fluentci/schema.graphql

This file was deleted.

31 changes: 31 additions & 0 deletions .fluentci/sdk/builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createGQLClient } from "./client.ts";
import { Context } from "./context.ts";
import { env } from "../deps.ts";

/**
* @hidden
*
* Initialize a default client context from environment.
*/
export function initDefaultContext(): Context {
let ctx = new Context();

// Prefer DAGGER_SESSION_PORT if set
const daggerSessionPort = env.get("DAGGER_SESSION_PORT");
if (daggerSessionPort) {
const sessionToken = env.get("DAGGER_SESSION_TOKEN");
if (!sessionToken) {
throw new Error(
"DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT"
);
}

ctx = new Context({
client: createGQLClient(Number(daggerSessionPort), sessionToken),
});
} else {
throw new Error("DAGGER_SESSION_PORT must be set");
}

return ctx;
}
Loading

0 comments on commit ad1bcb1

Please sign in to comment.