diff --git a/provision/task/docker.yml b/provision/task/docker.yml index 3f01e88..86e9f06 100644 --- a/provision/task/docker.yml +++ b/provision/task/docker.yml @@ -1,3 +1,4 @@ +--- version: "3" tasks: diff --git a/provision/task/go.yml b/provision/task/go.yml index d0f4bee..d35d20c 100644 --- a/provision/task/go.yml +++ b/provision/task/go.yml @@ -21,6 +21,12 @@ tasks: - sh: command -v go msg: "Please Install Go" + check:module: + desc: Has Module + preconditions: + - sh: '[ -n "{{.MODULE}}" ]' + msg: "Please add var environment module MODULE" + check:gofmt: desc: Exist gofmt run: once @@ -91,13 +97,36 @@ tasks: deps: - task: check:go + mockery: + desc: Refreshes the mock implementations in ./mocks. + preconditions: + - sh: which mockery + msg: mockery is not installed. Please install it using the following command. + + $ go install github.com/vektra/mockery/v2@v2.38.0 + cmds: + - mockery --config .ci/config/mockery.yaml + + generate: + desc: "Generate code with Wire" + cmds: + - go get github.com/google/wire/cmd/wire + - wire ./... + test: desc: Run go test against code. - run: once + deps: + - task: check:go cmds: - - go test -v ./... -coverprofile cover.out -timeout 60m + - go test -race -v ./... -coverprofile cover.out -timeout 60m + + test:module: + desc: Run go test to module against code. deps: - task: check:go + - task: check:module + cmds: + - go test -race -v ./modules/{{ .MODULE }}/... -coverprofile cover.out -timeout 60m build: desc: Build go packages. diff --git a/provision/task/packer.yml b/provision/task/packer.yml new file mode 100644 index 0000000..2e2aca1 --- /dev/null +++ b/provision/task/packer.yml @@ -0,0 +1,66 @@ +version: "3" + +tasks: + check: + desc: Exist packer and dependences + run: once + deps: + - task: check:packer + + check:packer: + desc: Exist packer + run: once + preconditions: + - sh: command -v packer + msg: "Please Install packer" + + command: + desc: make command packer + run: once + deps: + - task: check + cmds: + - cmd: packer {{.PACKER_COMMAND}} {{.PACKER_DIR}}/{{.REGION}}/arch/{{.ARCH}}/{{.IMAGE}} + vars: + REGION: us-east-1 + ARCH: amd64 + + init: + desc: make packer init + run: once + deps: + - task: check + cmds: + - task: command + vars: + PACKER_COMMAND: init + + build: + desc: make packer build + run: once + deps: + - task: check + cmds: + - task: command + vars: + PACKER_COMMAND: build + + validate: + desc: make packer validate + run: once + deps: + - task: check + cmds: + - task: command + vars: + PACKER_COMMAND: validate + + fmt: + desc: packer fmt + run: once + deps: + - task: check + cmds: + - task: command + vars: + PACKER_COMMAND: fmt diff --git a/provision/task/python.yml b/provision/task/python.yml index e9d8f26..19dc5bd 100644 --- a/provision/task/python.yml +++ b/provision/task/python.yml @@ -1,3 +1,4 @@ +--- version: "3" tasks: @@ -50,8 +51,7 @@ tasks: desc: run pytest. run: once cmds: - - cmd: >- - poetry run pytest + - cmd: poetry run pytest -s environment: desc: Generate environment python.