Files
glint/Taskfile.yml
T

139 lines
4.5 KiB
YAML
Raw Permalink Normal View History

2026-06-05 01:29:07 +02:00
version: "3"
vars:
2026-06-10 22:40:42 +02:00
BINARY: glint
2026-06-05 01:29:07 +02:00
GO: /usr/local/go/bin/go
tasks:
default:
desc: List available tasks
cmd: task --list
build:
2026-06-10 22:40:42 +02:00
desc: Build the glint binary
2026-06-05 01:29:07 +02:00
cmds:
2026-06-10 22:40:42 +02:00
- "{{.GO}} build -o {{.BINARY}} ./cmd/glint/..."
2026-06-05 01:29:07 +02:00
sources:
- "**/*.go"
- go.mod
generates:
- "{{.BINARY}}"
test:
desc: Run Go unit tests
cmd: "{{.GO}} test ./..."
validate:
2026-06-10 22:40:42 +02:00
desc: Run glint against all testdata fixtures
2026-06-05 01:29:07 +02:00
deps: [build]
cmds:
- cmd: ./{{.BINARY}} check testdata/valid.yml
2026-06-05 01:29:07 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/extends.yml
2026-06-05 01:29:07 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/keywords_valid.yml
2026-06-05 01:29:07 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/invalid.yml
2026-06-05 01:29:07 +02:00
ignore_error: true
- cmd: ./{{.BINARY}} check testdata/needs.yml
2026-06-05 01:29:07 +02:00
ignore_error: true
- cmd: ./{{.BINARY}} check testdata/needs_cycle.yml
2026-06-05 01:29:07 +02:00
ignore_error: true
- cmd: ./{{.BINARY}} check testdata/keywords_invalid.yml
2026-06-05 01:29:07 +02:00
ignore_error: true
- cmd: ./{{.BINARY}} check testdata/includes_remote.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/includes_project.yml
2026-06-07 20:13:03 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/includes_component.yml
2026-06-07 20:13:03 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/script_multiline.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/context_rules.yml
2026-06-07 23:13:52 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check --branch main testdata/context_rules.yml
2026-06-07 23:13:52 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check --branch develop testdata/context_rules.yml
2026-06-07 23:13:52 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check --branch feat/my-feature testdata/context_rules.yml
2026-06-07 23:13:52 +02:00
ignore_error: false
- cmd: ./{{.BINARY}} check --tag v1.0.0 testdata/context_rules.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/rules_if_expr.yml
ignore_error: false
- cmd: ./{{.BINARY}} check --branch main testdata/rules_if_expr.yml
ignore_error: false
- cmd: ./{{.BINARY}} check --branch feat/x testdata/rules_if_expr.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/workflow_vars.yml
ignore_error: false
- cmd: ./{{.BINARY}} check --branch main testdata/workflow_vars.yml
ignore_error: false
- cmd: ./{{.BINARY}} check --branch develop testdata/workflow_vars.yml
ignore_error: false
- cmd: ./{{.BINARY}} check --branch feat/x testdata/workflow_vars.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/variable_refs.yml
ignore_error: false
2026-06-11 23:56:09 +02:00
- cmd: ./{{.BINARY}} check testdata/variable_refs_included.yml
ignore_error: false
2026-06-11 23:56:09 +02:00
- cmd: ./{{.BINARY}} check testdata/samba/.gitlab-ci.yml
ignore_error: false
2026-06-11 23:56:09 +02:00
- cmd: ./{{.BINARY}} check testdata/samba/.gitlab-ci-coverage.yml
ignore_error: false
- cmd: ./{{.BINARY}} check testdata/samba/.gitlab-ci-private.yml
2026-06-07 23:13:52 +02:00
ignore_error: false
2026-06-05 01:29:07 +02:00
lint-go:
desc: Run go vet on all packages
cmd: "{{.GO}} vet ./..."
2026-06-11 23:56:09 +02:00
lint-static:
desc: Run staticcheck on all packages
cmd: "{{.GO}} tool staticcheck ./..."
2026-06-05 01:29:07 +02:00
ci:
2026-06-11 23:56:09 +02:00
desc: Full CI check — vet, staticcheck, test, build, validate
2026-06-05 01:29:07 +02:00
cmds:
- task: lint-go
2026-06-11 23:56:09 +02:00
- task: lint-static
2026-06-05 01:29:07 +02:00
- task: test
- task: build
- task: validate
2026-06-10 22:40:42 +02:00
build-windows:
desc: Build the glint binary for Windows x64 (requires a tagged commit)
vars:
TAG:
sh: git describe --tags --exact-match
preconditions:
- sh: git describe --tags --exact-match
msg: "Current commit is not tagged — Windows build requires a git tag"
cmds:
- "GOOS=windows GOARCH=amd64 {{.GO}} build -o {{.BINARY}}-{{.TAG}}.exe ./cmd/glint/..."
sources:
- "**/*.go"
- go.mod
generates:
- "{{.BINARY}}-{{.TAG}}.exe"
build-linux:
desc: Build the glint binary for Linux x64 (requires a tagged commit)
vars:
TAG:
sh: git describe --tags --exact-match
preconditions:
- sh: git describe --tags --exact-match
msg: "Current commit is not tagged — Linux build requires a git tag"
cmds:
- "GOOS=linux GOARCH=amd64 {{.GO}} build -o {{.BINARY}}-{{.TAG}}-linux-amd64 ./cmd/glint/..."
sources:
- "**/*.go"
- go.mod
generates:
- "{{.BINARY}}-{{.TAG}}-linux-amd64"
2026-06-05 01:29:07 +02:00
clean:
desc: Remove build artifacts
2026-06-10 22:40:42 +02:00
cmd: rm -f {{.BINARY}} {{.BINARY}}-*.exe {{.BINARY}}-*-linux-amd64