Split lint from test

main
Elie 2021-02-08 15:47:26 +01:00
parent 42595c13eb
commit 6e823b462a
No known key found for this signature in database
GPG Key ID: 399AF69092C727B6
2 changed files with 22 additions and 3 deletions

View File

@ -51,7 +51,7 @@ jobs:
${DISCORD_WEBHOOK}
- store_test_results:
path: ./
test:
lint:
docker:
- image: golang:1.15
steps:
@ -68,6 +68,13 @@ jobs:
exit 1
fi
- run: make install-tools
- run: make lint
test:
docker:
- image: golang:1.15
steps:
- checkout
- run: make install-tools
- run: make test
- run:
name: Codecov upload
@ -148,6 +155,11 @@ workflows:
- main
pullrequest:
jobs:
- lint:
filters:
branches:
ignore:
- main
- test:
filters:
branches:
@ -168,6 +180,12 @@ workflows:
only: /^v.*/
branches:
ignore: /.*/
- lint:
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- test:
filters:
tags:
@ -186,6 +204,7 @@ workflows:
- release:
context: driftctl
requires:
- lint
- test
- sign_release
filters:

View File

@ -25,7 +25,7 @@ release:
ENV=release scripts/build.sh
.PHONY: test
test: deps lint
test: deps
$(GOTEST) --format testname --junitfile unit-tests.xml -- -coverprofile=cover.out -coverpkg=.,./pkg/... ./...
.PHONY: coverage
@ -54,7 +54,7 @@ clean:
.PHONY: lint
lint:
@which golangci-lint > /dev/null 2>&1 || (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $(GOBINPATH) v1.31.0)
golangci-lint run --timeout=2m
golangci-lint run -v --timeout=4m
.PHONY: deps
deps: