44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Go build
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
go-version: [ 1.20.x, 1.21.x]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: '0'
|
|
lfs: 'true'
|
|
fetch-tags: 'true'
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
# Semantic version range syntax or exact version of Go
|
|
go-version: ${{ matrix.go-version }}
|
|
- id: govulncheck
|
|
uses: golang/govulncheck-action@v1
|
|
with:
|
|
go-version-input: ${{ matrix.go-version }}
|
|
go-package: ./...
|
|
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v6
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOMEMLIMIT: "1150MiB"
|
|
- name: Install gotestsum
|
|
run: go install gotest.tools/gotestsum@latest
|
|
- name: Run tests
|
|
run: gotestsum -f pkgname-and-test-fails -- -race -shuffle=on ./...
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
GOMEMLIMIT: "150MiB"
|