Skip to content

Commit 5d86c6b

Browse files
committed
ci: dagger support
Signed-off-by: Mark Sagi-Kazar <[email protected]>
1 parent 7d0c4c2 commit 5d86c6b

File tree

11 files changed

+268
-0
lines changed

11 files changed

+268
-0
lines changed

.envrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
if ! has nix_direnv_version || ! nix_direnv_version 2.1.0; then
2+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.1.0/direnvrc" "sha256-FAT2R9yYvVg516v3LiogjIc8YfsbWbMM/itqWsm5xTA="
3+
fi
4+
use flake

.github/workflows/dagger.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Dagger
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go: ['1.14', '1.15', '1.16', '1.17', '1.18']
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Dagger
22+
uses: dagger/dagger-for-github@v3
23+
with:
24+
cmds: |
25+
project update
26+
do check test go ${{ matrix.go }}
27+
28+
lint:
29+
name: Lint
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v3
35+
36+
- name: Dagger
37+
uses: dagger/dagger-for-github@v3
38+
with:
39+
cmds: |
40+
project update
41+
do check lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.direnv/
12
/tmp/
23
/vendor/
34

Taskfile.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
3+
tasks:
4+
check:
5+
cmds:
6+
- dagger do check
7+
8+
lint:
9+
cmds:
10+
- dagger do check lint
11+
12+
fmt:
13+
cmds:
14+
- golangci-lint run --fix

cue.mod/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/gen/
2+
/pkg/
3+
/tmp/

cue.mod/dagger.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github.com/sagikazarmark/dagger main

cue.mod/dagger.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github.com/sagikazarmark/dagger h1:tiyrgWTRtUgipmeZEaoN3y/ejlHHYI7pVSVTxmm/NWQ=

cue.mod/module.cue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module: "emperror.dev/errors"

dagger.cue

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package main
2+
3+
import (
4+
"dagger.io/dagger"
5+
6+
"universe.dagger.io/go"
7+
8+
"github.com/sagikazarmark/dagger/go/golangci"
9+
)
10+
11+
dagger.#Plan & {
12+
client: filesystem: ".": read: exclude: [
13+
".github",
14+
"bin",
15+
"build",
16+
"tmp",
17+
]
18+
// client: filesystem: "./build": write: contents: actions.build.debug.output
19+
client: network: "unix:///var/run/docker.sock": connect: dagger.#Socket
20+
21+
actions: {
22+
_source: client.filesystem["."].read.contents
23+
24+
check: {
25+
test: {
26+
"go": {
27+
"1.14": _
28+
"1.15": _
29+
"1.16": _
30+
"1.17": _
31+
"1.18": _
32+
33+
[v=string]: go.#Test & {
34+
source: _source
35+
name: "go_test_\(v)"
36+
package: "./..."
37+
38+
_image: go.#Image & {
39+
version: v
40+
}
41+
42+
input: _image.output
43+
command: flags: "-race": true
44+
}
45+
}
46+
}
47+
48+
lint: {
49+
"golangci": golangci.#Lint & {
50+
source: _source
51+
version: "1.46"
52+
}
53+
}
54+
}
55+
}
56+
}

flake.lock

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)