forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run golangci-lint in CircleCI, abandon GolangCI
Closes grafana#1365
- Loading branch information
Ivan Mirić
committed
Apr 24, 2020
1 parent
c30017b
commit f967a5f
Showing
2 changed files
with
40 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,43 @@ jobs: | |
dep check | ||
lint: | ||
docker: | ||
- image: circleci/golang:1.14 | ||
environment: | ||
GOPATH: /home/circleci/.go_workspace | ||
GOLANGCI_VERSION: v1.20.0 | ||
working_directory: /home/circleci/.go_workspace/src/github.com/loadimpact/k6 | ||
steps: | ||
# Workaround for custom env vars not available in cache keys | ||
# https://discuss.circleci.com/t/cannot-use-circle-yml-environment-variables-in-cache-keys/10994/8 | ||
- run: echo $GOLANGCI_VERSION > /tmp/.golangci.version | ||
- restore_cache: | ||
name: Restore golangci-lint cache | ||
key: golangci-lint-{{ arch }}-{{ checksum "/tmp/.golangci.version" }}-{{ .Environment.CACHE_VERSION }} | ||
paths: | ||
- /home/circleci/.go_workspace/bin/golangci-lint | ||
- run: | ||
name: Install golangci-lint | ||
command: | | ||
export PATH="$GOPATH/bin:$PATH" | ||
command -v golangci-lint && exit | ||
GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_VERSION | ||
- save_cache: | ||
name: Save golangci-lint cache | ||
key: golangci-lint-{{ arch }}-{{ checksum "/tmp/.golangci.version" }}-{{ .Environment.CACHE_VERSION }} | ||
paths: | ||
- /home/circleci/.go_workspace/bin/golangci-lint | ||
- checkout | ||
- run: | ||
name: Run golangci-lint | ||
command: | | ||
export PATH="$GOPATH/bin:$PATH" | ||
basecommit=$(echo $CIRCLE_COMPARE_URL | sed -n 's:.*compare/\([^.]*\)\..*$:\1:p') | ||
echo -e "$CIRCLE_COMPARE_URL\nbasecommit=$basecommit" | ||
golangci-lint run --out-format=tab --new-from-rev "${basecommit-master}" ./... | ||
test: | ||
docker: | ||
- image: circleci/golang:1.14 | ||
|
@@ -152,6 +189,8 @@ jobs: | |
curl --fail -H "X-GPG-PASSPHRASE: $GPG_PASSPHRASE" -T dist/k6-v$VERSION-amd64.deb "https://$BINTRAY_USER:[email protected]/content/loadimpact/deb/k6/$VERSION/k6-v$VERSION-amd64.deb;deb_distribution=stable;deb_component=main;deb_architecture=amd64;publish=1;override=1" | ||
# Publishing rpm | ||
curl --fail -H "X-GPG-PASSPHRASE: $GPG_PASSPHRASE" -T dist/k6-v$VERSION-amd64.rpm "https://$BINTRAY_USER:[email protected]/content/loadimpact/rpm/k6/$VERSION/k6-v$VERSION-amd64.rpm?publish=1&override=1" | ||
workflows: | ||
version: 2 | ||
test_and_build: | ||
|
@@ -160,6 +199,7 @@ workflows: | |
filters: | ||
tags: | ||
only: /.*/ | ||
- lint | ||
- test: | ||
filters: | ||
tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,3 @@ linters: | |
- godox | ||
- wsl | ||
fast: false | ||
|
||
service: | ||
golangci-lint-version: 1.20.x |