Skip to content

Commit

Permalink
Merge pull request #30 from silenceper/fix-github-actions
Browse files Browse the repository at this point in the history
update github action config
  • Loading branch information
silenceper authored Feb 8, 2021
2 parents 3a46a61 + b52ad32 commit e867f81
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 .

0 comments on commit e867f81

Please sign in to comment.