Skip to content

Commit

Permalink
ci: use Go 1.16, 1.17 and 1.18 (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Mar 31, 2022
1 parent 2a8fce5 commit d462647
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
38 changes: 25 additions & 13 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
name: Go
on:
push:
branches: [master]
branches: [ master ]
paths:
- '**.go'
- 'go.mod'
- '.golangci.yml'
- '.github/workflows/go.yml'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '.golangci.yml'
- '.github/workflows/go.yml'
env:
GOPROXY: "https://proxy.golang.org"

Expand All @@ -18,32 +28,34 @@ jobs:
with:
version: latest
args: --timeout=30m
- name: Check Go module tidiness
shell: bash
run: |
go mod tidy
STATUS=$(git status --porcelain go.mod go.sum)
if [ ! -z "$STATUS" ]; then
echo "Running go mod tidy modified go.mod and/or go.sum"
exit 1
fi
test:
name: Test
strategy:
matrix:
go-version: [1.14.x, 1.15.x, 1.16.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
go-version: [ 1.16.x, 1.17.x, 1.18.x ]
platform: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests
- name: Run tests with coverage
run: go test -v -race -coverprofile=coverage -covermode=atomic ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1.0.6
uses: codecov/codecov-action@v1.5.0
with:
file: ./coverage
flags: unittests
- name: Cache downloaded modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
4 changes: 3 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ coverage:
threshold: 1%

comment:
layout: 'diff, files'
layout: 'diff'

github_checks: false

0 comments on commit d462647

Please sign in to comment.