Skip to content

Commit

Permalink
Merge pull request #30 from bivas/updated-git-actions
Browse files Browse the repository at this point in the history
add go matrix and goverall action
  • Loading branch information
eranharel committed Jan 25, 2021
2 parents 0391903 + 9c012d5 commit 456c409
Showing 1 changed file with 25 additions and 9 deletions.
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

0 comments on commit 456c409

Please sign in to comment.