190 lines · 7.3 KB
import { describe, expect, mock, test } from "bun:test";

mock.module("cloudflare:workers", () => ({
  env: {},
  waitUntil: () => undefined,
  WorkflowEntrypoint: class {},
  DurableObject: class {},
  WorkerEntrypoint: class {},
}));

const { parseImageRef, isDigestPinned, imageTag } = await import("./images");
const { splitArgs } = await import("./compile-action");
const { parseActionManifest } = await import("./manifest");
const { compileWorkflow } = await import("../compile");
const { buildJobScript } = await import("../script");
const { parseWorkflow } = await import("../spec");
const { withDockerRunner, cloudRunnerSize } = await import("../runner-sizes");
const { runnerMeter } = await import("../../metering/ci");

const DIGEST = `sha256:${"c".repeat(64)}`;
const LUACHECK = `name: Luacheck
inputs:
  args:
    default: "."
runs:
  using: docker
  image: docker://ghcr.io/lunarmodules/luacheck:v1.2.0
  entrypoint: sh
  args:
    - -c
    - luacheck \${{ inputs.args }}
`;

const image = {
  ref: "ghcr.io/lunarmodules/luacheck:v1.2.0",
  registry: "ghcr.io",
  repository: "lunarmodules/luacheck",
  digest: DIGEST,
  mediaType: "application/vnd.oci.image.manifest.v1+json",
  manifestSize: 10,