Skip to content

add support of go 1.21 and go 1.22 (#12) #48

add support of go 1.21 and go 1.22 (#12)

add support of go 1.21 and go 1.22 (#12) #48

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.22', '1.21', '1.20', '1.19', '1.18', '1.17', '1.16', '1.15', '1.14', '1.13' ]
steps:
- uses: actions/checkout@v2
- name: "Setup Golang"
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
# https://github.com/actions/cache/blob/master/examples.md#go---modules
- name: "Cache Go Modules"
id: cache
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: "Download Go Modules"
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: "Test"
run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true