forked from loft-sh/devpod
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathTaskfile.yml
More file actions
215 lines (181 loc) · 6.51 KB
/
Taskfile.yml
File metadata and controls
215 lines (181 loc) · 6.51 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
version: "3"
tasks:
cli:tidy:
desc: tidy go.mod and go.sum
cmd: go mod tidy
cli:lint:
desc: lint go code using golangci-lint
cmd: golangci-lint run ./...
cli:lint:new:
desc: lint go code changed since origin/main using golangci-lint
cmd: golangci-lint run --new-from-rev="$(git merge-base HEAD origin/main)" ./... # or use --new-from-rev=HEAD~1 for changes since last push or --new for changes since last commit
cli:lint:fix:
desc: fix lint issues using golangci-lint
cmd: golangci-lint run --fix ./...
cli:format:
desc: format go code using golangci-lint formatters
cmd: golangci-lint fmt ./...
cli:act:lint:
desc: run devpod linters using act
cmd: act workflow_dispatch -W .github/workflows/lint.yml
cli:build:
desc: build devpod CLI
env:
GITHUB_REPOSITORY_OWNER: skevetter
cmd: goreleaser build --id devpod --snapshot --clean
cli:build:dev:
desc: build devpod CLI for development
env:
GITHUB_REPOSITORY_OWNER: skevetter
DEVPOD_CLI_VERSION: v0.0.0
cmd: goreleaser build --id devpod-dev --snapshot --clean
cli:build:dev:pro:
desc: build devpod CLI for pro feature
vars:
NS: '{{.NS | default "default"}}'
cmd: goreleaser build --id devpod-pro-dev --snapshot --clean
env:
GITHUB_REPOSITORY_OWNER: skevetter
DEVPOD_PRO_NS: "{{.NS}}"
cli:build:setup-cache:
desc: setup cache for CLI builds
deps:
- cli:build:dev
cmds:
- task: cli:build:teardown-cache
- mkdir -p "${TMPDIR:-/tmp/}devpod-cache"
- cp dist/devpod-dev_linux_amd64_v1/devpod-linux-amd64 "${TMPDIR:-/tmp/}devpod-cache/devpod-linux-amd64"
cli:build:teardown-cache:
desc: teardown cache for CLI builds
cmds:
- rm -rf "${TMPDIR:-/tmp/}devpod-cache"
cli:build:grpc:
desc: build devpod gRPC code
dir: pkg/agent/tunnel
cmd: |
# sudo apt install protobuf-compiler
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.4
protoc -I . tunnel.proto --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative
cli:test:
desc: run devpod unit tests
cmd: go test $(go list ./... | grep -v -e /test -e /e2e) -race -coverprofile=dist/profile.out -covermode=atomic
cli:test:e2e:build:
desc: build devpod for e2e tests
status:
- test -f e2e/bin/devpod-linux-amd64
cmds:
- task: cli:build:dev
- mkdir -p e2e/bin
- cp dist/devpod-dev_linux_amd64_v1/devpod-linux-amd64 e2e/bin/devpod-linux-amd64
cli:test:e2e:
desc: run e2e tests
deps:
- cli:test:e2e:build
- cli:test:e2e:ginkgo:install
dir: e2e
cmd: go run github.com/onsi/ginkgo/v2/ginkgo@latest
cli:test:e2e:suite:
# usage: task cli:test:e2e:suite -- "test suite name"
desc: run e2e tests suite
deps:
- cli:test:e2e:ginkgo:install
dir: e2e
cmd: go run github.com/onsi/ginkgo/v2/ginkgo@latest --label-filter {{ .CLI_ARGS }}
cli:test:e2e:focus:
# usage: task cli:test:e2e:focus -- "test suite pattern"
desc: run focused e2e tests
deps:
- cli:test:e2e:ginkgo:install
dir: e2e
cmd: go run github.com/onsi/ginkgo/v2/ginkgo@latest --focus {{ .CLI_ARGS }}
cli:test:e2e:kind:setup:
desc: setup kind cluster for e2e tests
cmd: kind create cluster --image kindest/node:v1.34.0@sha256:7416a61b42b1662ca6ca89f02028ac133a309a2a30ba309614e8ec94d976dc5a
cli:test:e2e:kind:teardown:
desc: teardown kind cluster for e2e tests
cmd: kind delete cluster
cli:test:e2e:ginkgo:install:
desc: install ginkgo for e2e tests
env:
GOPROXY: direct
status: [command -v ginkgo >/dev/null 2>&1]
cmd: go install github.com/onsi/ginkgo/v2/ginkgo@latest
cli:test:e2e:act:focus:
# usage: task cli:test:e2e:act:focus -- "test focus pattern"
desc: run e2e tests using act with focus
cmd: act workflow_dispatch -W .github/workflows/act.yml -j e2e-test --input test_focus={{ .CLI_ARGS }}
desktop:build:
desc: build devpod Desktop application
dir: desktop
cmds:
- cmd: yarn install --frozen-lockfile
- task: desktop:check
- cmd: yarn build
desktop:check:
desc: check desktop application
dir: desktop
cmds:
- cmd: yarn lint:ci
- cmd: yarn format:check
- cmd: yarn types:check
desktop:update-deps:
desc: update yarn dependencies
dir: desktop
cmd: yarn upgrade --latest
desktop:tauri:setup:
desc: setup tauri desktop application
dir: desktop
cmds:
- task: cli:build:dev
- cmd: cp ../dist/devpod-dev_linux_amd64_v1/devpod-linux-amd64 ./src-tauri/bin/devpod-x86_64-unknown-linux-gnu
- cmd: yarn install --frozen-lockfile
desktop:tauri:generate-types:
desc: generate desktop types
dir: desktop/src-tauri
cmds:
- rm -rf ../src/gen && mkdir -p ../dist
- touch ../dist/index.html
- cargo test
- mkdir -p ../src/gen
- cp -r bindings/* ../src/gen/
- rm -rf bindings
- |
touch ../src/gen/index.ts
for f in ../src/gen/*.ts; do
echo "export * from './$(basename "$f" .ts)'" >> ../src/gen/index.ts
done
- cd ../ && yarn prettier --write src/gen
desktop:tauri:generate-signing-keys:
desc: Generate Tauri signing keys
dir: desktop
cmd: yarn tauri signer generate --ci -w ../app.key
desktop:tauri:dev:
desc: run tauri application in dev mode
dir: desktop
cmd: yarn desktop:dev
desktop:tauri:build-app:
desc: build tauri application
dir: desktop
cmd: yarn desktop:build:dev
desktop:tauri:update-deps:
desc: update tauri dependencies
dir: desktop/src-tauri
cmd: cargo update
desktop:act:build:ui:
desc: build desktop ui using act
cmd: act workflow_dispatch -W .github/workflows/act.yml -j build-ui
desktop:act:build:app:
desc: build desktop application using act
cmd: act workflow_dispatch -W .github/workflows/act.yml -j build-desktop
desktop:act:build:flatpak:
desc: build desktop flatpak using act
cmd: act workflow_dispatch -W .github/workflows/act.yml -j build-flatpak
github:dev-release:upload:
desc: upload dev binaries to GitHub release tag v0.0.0-10 for testing
cmds:
- cmd: |
TMP_DIR="$(mktemp -d)"
cp dist/devpod-dev_linux_amd64_v1/devpod-linux-amd64 "$TMP_DIR/devpod-linux-amd64"
gh release upload v0.0.0-10 dist/devpod-dev_linux_amd64_v1/devpod-linux-amd64 --repo skevetter/devpod --clobber
rm -rf "$TMP_DIR"