From b52ad324ffcdb13c31ae74821de86e408e282670 Mon Sep 17 00:00:00 2001 From: silenceper Date: Mon, 8 Feb 2021 14:55:50 +0800 Subject: [PATCH] update github action config --- .github/workflows/go.yml | 55 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c18e03a..f3d0bac 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,32 +1,35 @@ name: Go -on: [push] -jobs: +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + golangci: + strategy: + matrix: + go-version: [1.15.x] + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + with: + # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. + version: v1.31 build: - name: Build + name: Test runs-on: ubuntu-latest steps: + - uses: actions/checkout@v2 + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go + - name: Test + run: go test -v -race ./... - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v1 - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v1.2.1 - with: - # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.26 - - name: Test - run: go test -coverprofile=coverage.txt -covermode=atomic -race ./... - - name: Upload Coverage report to CodeCov - uses: codecov/codecov-action@v1 - with: - token: ${{secrets.CODECOV_TOKEN}} - file: ./coverage.txt - - name: Build - run: go build -v .