0457432d42
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.4 to 3.2.3. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3.0.4...v3.2.3) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
56 lines
1.2 KiB
YAML
56 lines
1.2 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.16
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
- name: Setup golangci-lint
|
|
uses: golangci/golangci-lint-action@v3.2.0
|
|
with:
|
|
version: v1.41.1
|
|
args: --verbose
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GO111MODULE: on
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.13, 1.14, 1.15, 1.16, 1.17]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/cache@v3.2.3
|
|
with:
|
|
path: |
|
|
~/.cache/go-build
|
|
~/go/pkg/mod
|
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Build
|
|
run: go build -v ./...
|
|
|
|
- name: Test
|
|
run: go test -race -v -count=1 -coverprofile=coverage.out ./...
|
|
- uses: codecov/codecov-action@v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
flags: go-${{ matrix.go-version }}
|