-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
65 lines (54 loc) · 1.6 KB
/
Taskfile.yml
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
version: "3"
tasks:
build:
desc: Builds the app into a binary.
cmds:
- go build main.go
lint:
desc: Runs the linter.
cmds:
- golangci-lint run {{.CLI_ARGS}}
docker:build:
desc: Builds a Docker image using Nix.
cmds:
- nix build .#container
docker:load:
desc: Loads the Docker image from tar (in results).
cmds:
- docker load < result
docker:publish:
desc: Publishes the Docker image
deps:
- docker:load
cmds:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker image tag optinix:0.1 $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
- docker image tag optinix:0.1 $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG $CI_REGISTRY_IMAGE:latest
- docker push $CI_REGISTRY_IMAGE:latest
format:
desc: Runs the formatter.
cmds:
- goimports -local gitlab.com/hmajid2301/optinix -w .
tests:unit:
desc: Runs all the unit tests.
cmds:
- go test -v -short ./...
tests:integration:
desc: Runs all the integration tests.
cmds:
- go test -run ^TestIntegration -v ./...
tests:
desc: Runs all the tests.
cmds:
- go test -run ./...
coverage:
desc: Run the integration tests and gets the code coverage
cmds:
- go test -covermode count -coverprofile=coverage.txt -v ./... | tee output.txt
- cat output.txt | go-junit-report -set-exit-code > report.xml
- gocover-cobertura < coverage.txt > coverage.xml
release:
desc: Release the CLI tool.
cmds:
- goreleaser release --clean --verbose