Skip to content

Commit

Permalink
Merge pull request #4 from fluent-ci-templates/zenith
Browse files Browse the repository at this point in the history
Make it compatible with Dagger Zenith
  • Loading branch information
tsirysndr authored Oct 22, 2023
2 parents 32b36c9 + 8becc94 commit b2a8e92
Show file tree
Hide file tree
Showing 550 changed files with 1,044 additions and 17,242 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
sudo mv bin/dagger /usr/local/bin
dagger version
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: fluentci run deno_pipeline fmt lint test
- name: Upload Coverage
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
run: deno install -A -r https://cli.fluentci.io -n fluentci
- name: Setup Dagger
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: dagger run deno run -A ../src/dagger/runner.ts
run: |
rm ../deno.lock
dagger run deno run -A ../src/dagger/runner.ts
working-directory: example
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions

name: build
name: Zenith Example
on:
push:
branches:
- main
- zenith

jobs:
build:
tests:
runs-on: ubuntu-latest
steps:
- 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
- name: Setup Dagger Zenith
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: fluentci run gradle_pipeline
run: |
dagger query --doc check.gql
dagger query --doc test.gql
dagger query --doc build.gql
working-directory: example
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,20 @@ fluentci
| test | Run the tests |
| build | Build the project |

```graphql
build(src: String!): String
check(src: String!): String
test(src: String!): String
```

## Programmatic usage

You can also use this pipeline programmatically:

```ts
import Client, { connect } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import { check, test, build } from "https://pkg.fluentci.io/gradle_pipeline@v0.3.1/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
await check(client, src);
await test(client, src);
await build(client, src);
});
}

pipeline();
import { check, test, build } from "https://pkg.fluentci.io/gradle_pipeline@v0.4.0/mod.ts";

await check();
await test();
await build();
```
15 changes: 4 additions & 11 deletions ci.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
import Client, { connect } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import {
check,
test,
build,
} from "https://pkg.fluentci.io/gradle_pipeline@v0.3.1/mod.ts";
} from "https://pkg.fluentci.io/gradle_pipeline@v0.4.0/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
await check(client, src);
await test(client, src);
await build(client, src);
});
}

pipeline();
await check();
await test();
await build();
5 changes: 5 additions & 0 deletions dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"root": "",
"name": "gradle",
"sdkRuntime": "tsiry/dagger-sdk-deno"
}
24 changes: 19 additions & 5 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,29 @@
"tasks": {
"esm:add": "deno run -A https://esm.sh/v128 add",
"esm:update": "deno run -A https://esm.sh/v128 update",
"esm:remove": "deno run -A https://esm.sh/v128 remove"
"esm:remove": "deno run -A https://esm.sh/v128 remove",
"schema": "deno run -A src/dagger/schema.ts",
"clean": "rm -rf gen schema.graphql"
},
"fmt": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
},
"lint": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
},
"test": {
"exclude": ["example/", ".fluentci/"]
"exclude": [
"example/",
".fluentci/",
"gen/"
]
}
}
}
76 changes: 75 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 23 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts";
import Client from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import Client from "https://sdk.fluentci.io/z1/mod.ts";
export default Client;

export { connect, uploadContext } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
export {
connect,
uploadContext,
CacheSharingMode,
} from "https://sdk.fluentci.io/z1/mod.ts";
export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts";
export { withDevbox } from "https://nix.fluentci.io/v0.5.1/src/dagger/steps.ts";
export { withDevbox } from "https://nix.fluentci.io/zenith/src/dagger/steps.ts";
export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1";
import gql from "https://esm.sh/graphql-tag@2.12.6";
export { gql };

export {
arg,
queryType,
stringArg,
intArg,
nonNull,
makeSchema,
} from "npm:nexus";
export {
dirname,
join,
resolve,
} from "https://deno.land/std@0.203.0/path/mod.ts";

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";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Do not edit this file directly. It is generated by https://deno.land/x/fluent_github_actions

name: build
name: Zenith Example
on:
push:
branches:
- main
- zenith

jobs:
build:
tests:
runs-on: ubuntu-latest
steps:
- 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
- name: Setup Dagger Zenith
run: |
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh
curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.8 sh
sudo mv bin/dagger /usr/local/bin
dagger version
- name: Run Dagger Pipelines
run: fluentci run gradle_pipeline
run: |
dagger query --doc check.gql
dagger query --doc test.gql
dagger query --doc build.gql
working-directory: example
17 changes: 5 additions & 12 deletions example/.fluentci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,9 @@ fluentci
You can also use this pipeline programmatically:

```ts
import Client, { connect } from "https://sdk.fluentci.io/v0.1.9/mod.ts";
import { check, test, build } from "https://pkg.fluentci.io/gradle_pipeline@v0.3.1/mod.ts";

function pipeline(src = ".") {
connect(async (client: Client) => {
await check(client, src);
await test(client, src);
await build(client, src);
});
}

pipeline();
import { check, test, build } from "https://pkg.fluentci.io/gradle_pipeline@v0.4.0/mod.ts";

await check();
await test();
await build();
```
5 changes: 5 additions & 0 deletions example/.fluentci/dagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"root": "",
"name": "gradle",
"sdkRuntime": "tsiry/dagger-sdk-deno"
}
Loading

0 comments on commit b2a8e92

Please sign in to comment.