diff --git a/.github/workflows/zenith.yml b/.github/workflows/zenith.yml index 06932be..e0e92d6 100644 --- a/.github/workflows/zenith.yml +++ b/.github/workflows/zenith.yml @@ -21,4 +21,5 @@ jobs: dagger query --doc test.gql dagger query --doc llvm_cov.gql dagger query --doc build.gql + dagger query --doc clippy.gql working-directory: example diff --git a/example/.fluentci/src/dagger/jobs.ts b/example/.fluentci/src/dagger/jobs.ts index d1846d5..d79037f 100644 --- a/example/.fluentci/src/dagger/jobs.ts +++ b/example/.fluentci/src/dagger/jobs.ts @@ -24,6 +24,7 @@ const getDirectory = ( }; export const clippy = async (src: string | Directory | undefined = ".") => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -48,15 +49,16 @@ export const clippy = async (src: string | Directory | undefined = ".") => { ]) .withExec(["ls", "-la", "/app"]); - await ctr - .file("/app/rust-clippy-results.sarif") - .export("./rust-clippy-results.sarif"); + const results = await ctr.file("/app/rust-clippy-results.sarif"); + results.export("./rust-clippy-results.sarif"); await ctr.stdout(); + id = await results.id(); }); - return "Done"; + return id; }; export const llvmCov = async (src: string | Directory | undefined = ".") => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -100,10 +102,12 @@ export const llvmCov = async (src: string | Directory | undefined = ".") => { ]) .withExec(["ls", "-la", "/app"]); - await ctr.file("/app/lcov.info").export("./lcov.info"); + const lcov = ctr.file("/app/lcov.info"); + await lcov.export("./lcov.info"); await ctr.stdout(); + id = await lcov.id(); }); - return "Done"; + return id; }; export const test = async ( @@ -126,7 +130,7 @@ export const test = async ( console.log(result); }); - return "done"; + return "Done"; }; export const build = async ( @@ -135,6 +139,7 @@ export const build = async ( target = "x86_64-unknown-linux-gnu", options: string[] = [] ) => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -163,8 +168,9 @@ export const build = async ( const result = await ctr.stdout(); console.log(result); + id = await ctr.directory("/app/target").id(); }); - return "done"; + return id; }; export type JobExec = (src?: string) => diff --git a/example/.fluentci/src/dagger/schema.ts b/example/.fluentci/src/dagger/schema.ts index b8f36fe..ce63350 100644 --- a/example/.fluentci/src/dagger/schema.ts +++ b/example/.fluentci/src/dagger/schema.ts @@ -59,6 +59,9 @@ schema.description = JSON.stringify({ "test.src": "directory", "build.src": "directory", "llvmCov.src": "directory", + clippy: "file", + llvmCov: "file", + build: "directory", }); export { schema }; diff --git a/example/build.gql b/example/build.gql index 7f76662..2785dde 100644 --- a/example/build.gql +++ b/example/build.gql @@ -1,5 +1,7 @@ { rust { - build + build { + id + } } } diff --git a/example/clippy.gql b/example/clippy.gql new file mode 100644 index 0000000..e2ded60 --- /dev/null +++ b/example/clippy.gql @@ -0,0 +1,7 @@ +{ + rust { + clippy { + id + } + } +} diff --git a/example/llvm_cov.gql b/example/llvm_cov.gql index a636ef6..06f3586 100644 --- a/example/llvm_cov.gql +++ b/example/llvm_cov.gql @@ -1,5 +1,7 @@ { rust { - llvmCov + llvmCov { + id + } } } diff --git a/src/dagger/jobs.ts b/src/dagger/jobs.ts index d1846d5..d79037f 100644 --- a/src/dagger/jobs.ts +++ b/src/dagger/jobs.ts @@ -24,6 +24,7 @@ const getDirectory = ( }; export const clippy = async (src: string | Directory | undefined = ".") => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -48,15 +49,16 @@ export const clippy = async (src: string | Directory | undefined = ".") => { ]) .withExec(["ls", "-la", "/app"]); - await ctr - .file("/app/rust-clippy-results.sarif") - .export("./rust-clippy-results.sarif"); + const results = await ctr.file("/app/rust-clippy-results.sarif"); + results.export("./rust-clippy-results.sarif"); await ctr.stdout(); + id = await results.id(); }); - return "Done"; + return id; }; export const llvmCov = async (src: string | Directory | undefined = ".") => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -100,10 +102,12 @@ export const llvmCov = async (src: string | Directory | undefined = ".") => { ]) .withExec(["ls", "-la", "/app"]); - await ctr.file("/app/lcov.info").export("./lcov.info"); + const lcov = ctr.file("/app/lcov.info"); + await lcov.export("./lcov.info"); await ctr.stdout(); + id = await lcov.id(); }); - return "Done"; + return id; }; export const test = async ( @@ -126,7 +130,7 @@ export const test = async ( console.log(result); }); - return "done"; + return "Done"; }; export const build = async ( @@ -135,6 +139,7 @@ export const build = async ( target = "x86_64-unknown-linux-gnu", options: string[] = [] ) => { + let id = ""; await connect(async (client: Client) => { const context = getDirectory(client, src); const ctr = client @@ -163,8 +168,9 @@ export const build = async ( const result = await ctr.stdout(); console.log(result); + id = await ctr.directory("/app/target").id(); }); - return "done"; + return id; }; export type JobExec = (src?: string) => diff --git a/src/dagger/schema.ts b/src/dagger/schema.ts index b8f36fe..ce63350 100644 --- a/src/dagger/schema.ts +++ b/src/dagger/schema.ts @@ -59,6 +59,9 @@ schema.description = JSON.stringify({ "test.src": "directory", "build.src": "directory", "llvmCov.src": "directory", + clippy: "file", + llvmCov: "file", + build: "directory", }); export { schema };