Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add go matrix and goverall action #30

Merged
merged 3 commits into from
Jan 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@ name: go-build
on: [push, pull_request]
jobs:
build:
name: build, test, lint
name: build ( ${{ matrix.go }} ), test, lint
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.15', '1.14', '1.13' ]
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13

- name: Check out source code
uses: actions/checkout@v1
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

- name: Build
env:
Expand All @@ -21,10 +24,23 @@ jobs:
- name: Test
env:
GOPROXY: "https://proxy.golang.org"
run: go test -v ./...
run: go test -v -race -coverprofile=coverage.out ./...

- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.20.0

- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run -E golint -E gosec -E gofmt
run: golangci-lint run -E golint -E gosec -E gofmt

- name: convert to lcov
if: ${{ matrix.go }} == '1.15'
run: |
go get -u github.com/jandelgado/gcov2lcov
gcov2lcov -infile=coverage.out -outfile=coverage.lcov

- name: Coveralls
uses: coverallsapp/github-action@master
if: ${{ matrix.go }} == '1.15'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov