* Bump CI Go versions * Fix changed fmt. * Only check vet on one version. * Bump minimum go version in go.mod * Add Darwin test. Replaces #3807
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Go
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }}
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
GO111MODULE: on
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.16.x, 1.17.x]
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
id: go
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Build on ${{ matrix.os }}
|
|
if: matrix.os == 'windows-latest'
|
|
run: |
|
|
go build --ldflags="-s -w" -o %GOPATH%\bin\mc.exe
|
|
go test -v -race --timeout 30m ./...
|
|
- name: Build on ${{ matrix.os }}
|
|
if: matrix.os == 'macos-latest'
|
|
run: |
|
|
go build --ldflags="-s -w" -o %GOPATH%\bin\mc
|
|
go test -v -race --timeout 30m ./...
|
|
- name: Build on ${{ matrix.os }}
|
|
if: matrix.os == 'ubuntu-latest'
|
|
run: |
|
|
make
|
|
make test-race
|
|
make verify
|
|
make crosscompile
|
|
vetchecks: # Run vet checks against one version.
|
|
env:
|
|
CGO_ENABLED: 0
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17.x
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: fmt
|
|
run: diff -au <(gofmt -s -d .) <(printf "")
|
|
|
|
- name: Test 386
|
|
run: GOOS=linux GOARCH=386 go test -short ./...
|
|
|