mirror of
https://github.com/dokku/dokku.git
synced 2025-12-16 12:07:45 +01:00
add codacy config and coverage targets
This commit is contained in:
@@ -20,10 +20,12 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
case $CIRCLE_NODE_INDEX in
|
case $CIRCLE_NODE_INDEX in
|
||||||
0) sudo -E make -e lint ;;
|
0) sudo -E make -e lint ;;
|
||||||
1) sudo -E make -e go-tests ;;
|
1) sudo -E make -e go-tests ci-go-coverage;;
|
||||||
2) sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
2) sudo -E make -e deploy-test-checks-root deploy-test-config deploy-test-multi deploy-test-go-fail-predeploy deploy-test-go-fail-postdeploy ;;
|
||||||
esac
|
esac
|
||||||
- run:
|
- run:
|
||||||
shell: /bin/bash
|
shell: /bin/bash
|
||||||
command: sudo -E make -e test-ci
|
command: sudo -E make -e test-ci
|
||||||
no_output_timeout: 60m
|
no_output_timeout: 60m
|
||||||
|
- store_artifacts:
|
||||||
|
path: ./coverage.out
|
||||||
|
|||||||
5
.codacy.yml
Normal file
5
.codacy.yml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
exclude_paths:
|
||||||
|
- vendor/**/*
|
||||||
|
- tests/**/*
|
||||||
|
- "**_test.go"
|
||||||
|
- contrib/*
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
|||||||
data/
|
data/
|
||||||
stack.tgz
|
stack.tgz
|
||||||
tmp
|
tmp
|
||||||
|
coverage.out
|
||||||
|
|||||||
15
tests.mk
15
tests.mk
@@ -73,6 +73,16 @@ lint:
|
|||||||
@echo linting...
|
@echo linting...
|
||||||
@$(QUIET) find . -not -path '*/\.*' -not -path './debian/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | egrep -B1 "bash" | grep "==>" | awk '{ print $$2 }' | xargs shellcheck -e SC2034
|
@$(QUIET) find . -not -path '*/\.*' -not -path './debian/*' -type f | xargs file | grep text | awk -F ':' '{ print $$1 }' | xargs head -n1 | egrep -B1 "bash" | grep "==>" | awk '{ print $$2 }' | xargs shellcheck -e SC2034
|
||||||
|
|
||||||
|
ci-go-coverage:
|
||||||
|
docker run --rm -ti \
|
||||||
|
-e DOKKU_ROOT=/home/dokku \
|
||||||
|
-e CODACY_TOKEN=$$CODACY_TOKEN \
|
||||||
|
-e CIRCLE_SHA1=$$CIRCLE_SHA1 \
|
||||||
|
-v $$PWD:$(GO_REPO_ROOT) \
|
||||||
|
-w $(GO_REPO_ROOT) \
|
||||||
|
$(BUILD_IMAGE) \
|
||||||
|
bash -c "go get github.com/schrej/godacov && godacov -t $$CODACY_TOKEN -r ./coverage.out -c $$CIRCLE_SHA1" || exit $$?
|
||||||
|
|
||||||
go-tests:
|
go-tests:
|
||||||
@echo running go unit tests...
|
@echo running go unit tests...
|
||||||
docker run --rm -ti \
|
docker run --rm -ti \
|
||||||
@@ -80,8 +90,9 @@ go-tests:
|
|||||||
-v $$PWD:$(GO_REPO_ROOT) \
|
-v $$PWD:$(GO_REPO_ROOT) \
|
||||||
-w $(GO_REPO_ROOT) \
|
-w $(GO_REPO_ROOT) \
|
||||||
$(BUILD_IMAGE) \
|
$(BUILD_IMAGE) \
|
||||||
bash -c "go get github.com/onsi/gomega && \
|
bash -c "go get github.com/onsi/gomega github.com/haya14busa/goverage && \
|
||||||
go list ./... | grep -v /vendor/ | grep -v /tests/apps/ | xargs go test -v -p 1 -race" || exit $$?
|
go list ./... | egrep -v '/vendor/|/tests/apps/' | xargs go test -v -p 1 -race && \
|
||||||
|
go list ./... | egrep -v '/vendor/|/tests/apps/' | xargs goverage -v -coverprofile=coverage.out" || exit $$?
|
||||||
|
|
||||||
unit-tests: go-tests
|
unit-tests: go-tests
|
||||||
@echo running bats unit tests...
|
@echo running bats unit tests...
|
||||||
|
|||||||
Reference in New Issue
Block a user