-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
151 lines (132 loc) · 3.69 KB
/
Taskfile.yaml
File metadata and controls
151 lines (132 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: "3"
vars:
BINARY: runnerd
IMAGE: ghcr.io/jimyag/e2b-github-runner
LDFLAGS: "-s -w"
TEMPLATE_DIR: templates/github-runner-ubuntu-24.04
GO_PACKAGES: "./cmd/... ./internal/..."
tasks:
default:
desc: List all tasks
cmds:
- task --list-all
silent: true
deps:
desc: Install local development tools
cmds:
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go install mvdan.cc/gofumpt@latest
- go install golang.org/x/tools/cmd/goimports@latest
- go install github.com/go-task/task/v3/cmd/task@latest
- go install github.com/goreleaser/goreleaser/v2@latest
fmt:
desc: Format Go code
cmds:
- gofumpt -w cmd internal
- goimports -w cmd internal
ui-deps:
desc: Install admin UI dependencies
dir: ui
cmds:
- bun install --frozen-lockfile
ui-build:
desc: Build the embedded admin UI
dir: ui
cmds:
- bun install --frozen-lockfile
- bun run build
ui-lint:
desc: Lint and type-check the admin UI
dir: ui
cmds:
- bun install --frozen-lockfile
- bun run lint
- bun run build
lint:
desc: Run staticcheck, formatting checks, goimports checks, and go vet
deps:
- ui-build
cmds:
- staticcheck {{.GO_PACKAGES}}
- cmd: |
UNFORMATTED=$(gofmt -l cmd internal)
if [ -n "$UNFORMATTED" ]; then
echo "unformatted files (run: gofmt -w .):"
echo "$UNFORMATTED"
exit 1
fi
- cmd: |
UNFORMATTED=$(gofumpt -l cmd internal)
if [ -n "$UNFORMATTED" ]; then
echo "unformatted files (run: gofumpt -w .):"
echo "$UNFORMATTED"
exit 1
fi
- cmd: |
UNFORMATTED=$(goimports -l cmd internal)
if [ -n "$UNFORMATTED" ]; then
echo "unformatted files (run: goimports -w .):"
echo "$UNFORMATTED"
exit 1
fi
- go vet {{.GO_PACKAGES}}
- task: ui-lint
test:
desc: Run tests with the race detector and coverage
deps:
- ui-build
cmds:
- GORACE=atexit_sleep_ms=0 go test -v -trimpath -failfast -race -cover -coverprofile=coverage.txt {{.GO_PACKAGES}}
build:
desc: Build the local binary into bin/
deps:
- ui-build
cmds:
- mkdir -p bin
- go build -trimpath -buildvcs=true -ldflags "{{.LDFLAGS}}" -o bin/{{.BINARY}} ./cmd/{{.BINARY}}
run:
desc: Run the service locally
deps:
- ui-build
cmds:
- go run ./cmd/{{.BINARY}} {{.CLI_ARGS}}
docker-build:
desc: Build the local Docker image
deps:
- ui-build
cmds:
- docker build -t {{.IMAGE}}:local .
docker-check:
desc: Check Dockerfiles without building image layers
cmds:
- docker build --check -f Dockerfile .
- docker build --check --platform=linux/amd64 -f {{.TEMPLATE_DIR}}/e2b.Dockerfile {{.TEMPLATE_DIR}}
template-deps:
desc: Install E2B template dependencies
dir: "{{.TEMPLATE_DIR}}"
cmds:
- npm install
template-build-dev:
desc: Build the development E2B sandbox template
dir: "{{.TEMPLATE_DIR}}"
cmds:
- npm run build:dev
template-build-prod:
desc: Build the production E2B sandbox template
dir: "{{.TEMPLATE_DIR}}"
cmds:
- npm run build:prod
release-check:
desc: Validate the GoReleaser configuration
cmds:
- goreleaser check
release-snapshot:
desc: Dry-run a GoReleaser release locally without publishing
deps:
- ui-build
cmds:
- goreleaser release --snapshot --clean
clean:
desc: Remove generated local build artifacts
cmds:
- rm -rf bin dist coverage.txt ui/node_modules