-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from grafana/github-action-ci
Setup basic CI pipeline as a GitHub action
- Loading branch information
Showing
21 changed files
with
265 additions
and
209 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
on: [pull_request] | ||
|
||
env: | ||
GO_VERSION: '1.21' | ||
|
||
jobs: | ||
linters: | ||
name: Linters | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Install vendors | ||
run: make deps | ||
|
||
- name: Run golangci-lint | ||
run: make lint | ||
|
||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
cache: true | ||
|
||
- name: Install vendors | ||
run: make deps | ||
|
||
- name: Tests | ||
run: make tests |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
linters: | ||
enable-all: true | ||
disable: | ||
- exhaustruct | ||
- wrapcheck | ||
- nolintlint | ||
- wastedassign | ||
- varnamelen | ||
- forcetypeassert | ||
- goerr113 | ||
- exhaustivestruct | ||
- ireturn | ||
- funlen | ||
- forbidigo | ||
- godot | ||
- godox | ||
- cyclop | ||
- prealloc | ||
- dupl | ||
- lll | ||
- maligned | ||
- goconst | ||
- depguard | ||
- exhaustive | ||
- wsl | ||
- unparam | ||
- gomoddirectives | ||
- gofumpt | ||
- nestif | ||
# deprecated | ||
- deadcode | ||
- scopelint | ||
- nosnakecase | ||
- golint | ||
- interfacer | ||
- structcheck | ||
- ifshort | ||
- varcheck | ||
|
||
linters-settings: | ||
errcheck: | ||
ignore: fmt:.* | ||
|
||
run: | ||
modules-download-mode: vendor |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GOLANGCI_LINT_VERSION='v1.54.2' | ||
|
||
.PHONY: lint | ||
lint: | ||
docker run --rm -v $(shell pwd):/app -w /app golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine golangci-lint run -c .golangci.yaml | ||
|
||
.PHONY: tests | ||
tests: | ||
go test -v ./... | ||
|
||
.PHONY: deps | ||
deps: | ||
go mod vendor |
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
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
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
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
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
Oops, something went wrong.