diff --git a/README.md b/README.md index 5c5b66a..d29dd58 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ llvmCov(src: String!): String You can also use this pipeline programmatically: ```ts -import { build, test } from "https://pkg.fluentci.io/rust_pipeline@v0.6.3/mod.ts"; +import { build, test } from "https://pkg.fluentci.io/rust_pipeline@v0.7.0/mod.ts"; await test(); await build(); diff --git a/ci.ts b/ci.ts index 576046d..6775c43 100644 --- a/ci.ts +++ b/ci.ts @@ -1,7 +1,7 @@ import { build, test, -} from "https://pkg.fluentci.io/rust_pipeline@v0.6.3/mod.ts"; +} from "https://pkg.fluentci.io/rust_pipeline@v0.7.0/mod.ts"; await test(); await build(); diff --git a/deno.lock b/deno.lock index 584cbf4..899d3da 100644 --- a/deno.lock +++ b/deno.lock @@ -31,6 +31,8 @@ "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/deps.ts": "096395daebc7ed8a18f0484e4ffcc3a7f70e50946735f7df9611a7fcfd8272cc", "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/mod.ts": "e269d71c72ae68e82c1960e5db2a0c7419c97c9683ef717de0ab75d90f364713", "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/src/tar.ts": "9b02eaaa784b225ad7a23d2769cd492adf113ea7c11c02e3646849e98f4ae43b", + "https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/optimized/lodash.js": "10c4df47937ffc78548d136dd535a021df5f57182a653260d715c0690dd22978", + "https://cdn.skypack.dev/lodash": "8280de0b3efd87f06ea0eb330d15b8de32c059556023b8c6524e9eb9e4844dc0", "https://deno.land/std@0.129.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", "https://deno.land/std@0.129.0/_util/os.ts": "49b92edea1e82ba295ec946de8ffd956ed123e2948d9bd1d3e901b04e4307617", "https://deno.land/std@0.129.0/archive/tar.ts": "35ea1baddec7988cc4034765a2cee7613bc8074bd40940d3f5e98f63070a716a", @@ -149,6 +151,9 @@ "https://deno.land/std@0.203.0/path/to_file_url.ts": "00e6322373dd51ad109956b775e4e72e5f9fa68ce2c6b04e4af2a6eed3825d31", "https://deno.land/std@0.203.0/path/to_namespaced_path.ts": "1b1db3055c343ab389901adfbda34e82b7386bcd1c744d54f9c1496ee0fd0c3d", "https://deno.land/std@0.203.0/path/win32.ts": "8b3f80ef7a462511d5e8020ff490edcaa0a0d118f1b1e9da50e2916bdd73f9dd", + "https://deno.land/std@0.205.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", + "https://deno.land/std@0.205.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", + "https://deno.land/std@0.205.0/flags/mod.ts": "0948466fc437f017f00c0b972a422b3dc3317a790bcf326429d23182977eaf9f", "https://deno.land/std@0.52.0/fmt/colors.ts": "ec9d653672a9a3c7b6eafe53c5bc797364a2db2dcf766ab649c1155fea7a80b2", "https://deno.land/x/crc32@v0.2.0/mod.ts": "de7a3fa2d4ef24b96fc21e1cc4d2d65d1d2b1dcea92f63960e3e11bfa82df0fa", "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts": "79cc758901d20a3573d7e3cc2db9f0a5fe56833f4d9befcedc072b94d542eec7", @@ -246,6 +251,8 @@ "https://esm.sh/yaml@v2.3.1": "1eebb55f799726dfa0698314b3ba178bc478cba64b31c8309284899c96f8ff8f", "https://nix.fluentci.io/v0.5.2/deps.ts": "6ccc8510c72998a52c24bc02c848b669413b5ef1d15dccd7e03a25dd0e408564", "https://nix.fluentci.io/v0.5.2/src/dagger/steps.ts": "b766f4fa9624a032e7af884a5ca47bc666a529c4a472d38b74b55ca0d63cf81d", + "https://pkg.fluentci.io/rust_pipeline@v0.6.3/deps.ts": "395058096336c6f1f2de401e767e707fef1922b4e15606fbc01505cea6028f33", + "https://pkg.fluentci.io/rust_pipeline@v0.6.3/src/dagger/jobs.ts": "3da68613b838754f493334bc26f2e4e3da5e0130498c00ff6c6f147e15f867ca", "https://sdk.fluentci.io/v0.2.0/deps.ts": "20dd191afaf88662b82c2a42164afe6d06f2e79942f40ce07aa0972719fc858f", "https://sdk.fluentci.io/v0.2.0/mod.ts": "261ba81a4728f5def4e327a5cd80664ea8449515a2f4eea5f3f416acae39a1fa", "https://sdk.fluentci.io/v0.2.0/src/client.ts": "d350d4f59763e32a9b35f3f06f0b1058e5c8e5a3824e6d096cdaf3fc4332dcf6", diff --git a/deps.ts b/deps.ts index 56da144..b79186b 100644 --- a/deps.ts +++ b/deps.ts @@ -27,6 +27,8 @@ export { join, resolve, } from "https://deno.land/std@0.203.0/path/mod.ts"; +export { parse } from "https://deno.land/std@0.205.0/flags/mod.ts"; +export { snakeCase, camelCase } from "https://cdn.skypack.dev/lodash"; export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts"; export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts"; diff --git a/src/dagger/runner.ts b/src/dagger/runner.ts index ce5e3a5..59f82f5 100644 --- a/src/dagger/runner.ts +++ b/src/dagger/runner.ts @@ -1,3 +1,17 @@ import pipeline from "./pipeline.ts"; +import { parse, camelCase, snakeCase } from "../../deps.ts"; -await pipeline(".", Deno.args); +const args = parse(Deno.args.map((x) => x.split(" ")).flat()); + +if (!Array.isArray(Deno.args)) { + for (const param of Object.keys(args) + .filter((x) => x !== "_") + .map((x) => snakeCase(x).toUpperCase())) { + Deno.env.set(param, args[camelCase(param)]); + } +} + +await pipeline( + ".", + Array.isArray(Deno.args) ? Deno.args : (args._ as string[]) +); diff --git a/src/github/config.ts b/src/github/config.ts index 34bf81a..31f6f54 100644 --- a/src/github/config.ts +++ b/src/github/config.ts @@ -7,11 +7,6 @@ export function generateYaml(): Workflow { branches: ["main"], }; - const setupDagger = `\ - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh - sudo mv bin/dagger /usr/local/bin - dagger version`; - const test: JobSpec = { "runs-on": "ubuntu-latest", steps: [ @@ -19,18 +14,8 @@ export function generateYaml(): Workflow { uses: "actions/checkout@v2", }, { - uses: "denoland/setup-deno@v1", - with: { - "deno-version": "v1.37", - }, - }, - { - name: "Setup Fluent CI CLI", - run: "deno install -A -r https://cli.fluentci.io -n fluentci", - }, - { - name: "Setup Dagger", - run: setupDagger, + name: "Setup Fluent CI", + uses: "fluentci-io/setup-fluentci@v1", }, { name: "Run Tests and Build",