Files
NixMsg/Taskfile.yml
T

78 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: "3"
vars:
BIN_DIR: bin
BIN_NAME: nixmsg
EMBED_TAG: embeddist
EXE: '{{if eq OS "windows"}}.exe{{end}}'
includes:
'*':
taskfile: taskfiles/*.yml
optional: true
w:
taskfile: taskfiles/w.yml
optional: true
tasks:
default:
desc: 显示可用任务
cmds:
- task --list
web:install:
desc: 安装前端依赖
dir: web
cmds:
- pnpm install
web:dev:
desc: 启动前端开发服务器
dir: web
deps: [web:install]
cmds:
- pnpm dev
web:build:
desc: 构建前端静态资源到 web/dist
dir: web
deps: [web:install]
cmds:
- pnpm build
build:
desc: 构建嵌入前端的单个可执行文件
deps: [web:build]
cmds:
- go build -tags {{.EMBED_TAG}} -o {{.BIN_DIR}}/{{.BIN_NAME}}{{.EXE}} ./cmd/nixmsg
env:
CGO_ENABLED: "0"
test:
desc: 运行单元测试
cmds:
- go test ./...
lint:
desc: 运行 golangci-lint
cmds:
- golangci-lint run ./...
check:
desc: 构建、检查与单元测试
cmds:
- task: build
- task: lint
- task: test
itest:
desc: 运行集成测试(含后台网页 Playwright e2e)
cmds:
- go test ./test/... -count=1
- task: w:e2e
docker:
desc: 构建开发用 Docker 镜像
cmds:
- docker build -t nixmsg:dev -f deploy/Dockerfile .