blob: f3e9e0847f7335031e5f42fc98dc3c95e4ff2cdf [file] [log] [blame]
name: Go
on:
push:
branches: ['*']
tags: ['v*']
pull_request:
branches: ['*']
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.17.x", "1.18.x", "1.19.x"]
include:
- go: 1.19.x
latest: true
steps:
- name: Setup Go
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Load cached dependencies
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v.4.0.2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Lint
if: matrix.latest
run: make lint
- name: Test
run: make cover
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@125fc84a9a348dbcf27191600683ec096ec9021c # v4.4.1
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}