mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
version: '3'
|
|
|
|
vars:
|
|
PKG: "./..."
|
|
FAILFAST: "-failfast"
|
|
TIMEOUT: "1m"
|
|
RUN: "''"
|
|
|
|
tasks:
|
|
default:
|
|
cmds:
|
|
- task: lint
|
|
- task: tests:local
|
|
|
|
lint:
|
|
cmds:
|
|
- golangci-lint run --fix --allow-parallel-runners --config ./../../.golangci.yml
|
|
|
|
tests:
|
|
cmds:
|
|
- go test -v -coverpkg {{.PKG}} -coverprofile coverage.out -covermode atomic {{.PKG}}
|
|
|
|
tests:local:
|
|
cmds:
|
|
- >
|
|
go test -v {{.FAILFAST}} -coverpkg {{.PKG}} -coverprofile coverage.out
|
|
-run {{.RUN}} -timeout {{.TIMEOUT}} {{.PKG}} |
|
|
sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' |
|
|
sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/'' |
|
|
sed ''/RUN/s//$(printf "\033[34mRUN\033[0m")/''
|
|
- task: coverage
|
|
|
|
coverage:
|
|
cmds:
|
|
- go tool cover -html=coverage.out -o coverage.html
|
|
- echo "To open the html coverage file, use one of the following commands:"
|
|
- echo "open coverage.html on mac"
|
|
- echo "xdg-open coverage.html on linux"
|
|
silent: true
|
|
|
|
sync:ledger:
|
|
cmds:
|
|
- rm -rf ./../../components/ledger/libs/*
|
|
- cp -R * ./../../components/ledger/libs/
|