This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
forked from louketo/louketo-proxy
-
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 as part of pull request workflow louketo#604
- Merge build and linter jobs in a single file - Runs tests for go 1.13 and 1.14 - Introduces code coverage with coveralls - Fixes some issues reported by golangci-lint and relax/disable some rules until the codebase is refactored Resolves louketo#604
- Loading branch information
Bruno Oliveira da Silva
committed
May 14, 2020
1 parent
c500821
commit 92a2009
Showing
7 changed files
with
74 additions
and
12 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,53 @@ | ||
name: Build & Lint | ||
|
||
# Only trigger the event on pull-requests | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
# Test the latest release of Go | ||
strategy: | ||
matrix: | ||
go: [ '1.14', '1.13' ] | ||
steps: | ||
# Setup the workflow to use the specific version of Go | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
# Checkout the repository | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# Verify downloaded dependencies | ||
- name: Verify dependencies | ||
run: go mod verify | ||
# Run tests and generates a coverage profile | ||
- name: Test | ||
run: | | ||
go test -v -coverprofile=profile.cov ./... | ||
# Run Go benchmarks | ||
- name: Benchmark | ||
run: | | ||
go test -bench=. -benchmem | ||
# Sends code coverage report to Coveralls | ||
- name: Coveralls | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
GO111MODULE=off go get github.com/mattn/goveralls | ||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github | ||
# Run the linter as a separate job | ||
golangci: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
version: v1.26 | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" |
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
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