Skip to content

ci: add latest Go version and add cache (#54) #126

ci: add latest Go version and add cache (#54)

ci: add latest Go version and add cache (#54) #126

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GOLANGCI_LINT_VERSION: "v1.61.0"
jobs:
build:
strategy:
matrix:
go-version: [ '1.17', '1.18', '1.19', '1.20', '1.21', '1.22', '1.23']
os: [ ubuntu-22.04, macos-12, windows-2022 ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Enforce standard format
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
args: --timeout 3m --enable=gofmt --verbose
- name: Test
run: go test --cover -v ./...
- name: Build
run: go build -v ./...