Bump CI Go versions (#3811)

* 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
This commit is contained in:
Klaus Post
2021-09-28 09:19:52 -07:00
committed by GitHub
parent 1bcd5df300
commit 7e6f46fba6
17 changed files with 47 additions and 12 deletions
+28 -9
View File
@@ -9,10 +9,12 @@ 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]
os: [ubuntu-latest, windows-latest]
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
@@ -25,20 +27,37 @@ jobs:
- name: Build on ${{ matrix.os }}
if: matrix.os == 'windows-latest'
env:
GO111MODULE: on
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'
env:
GO111MODULE: on
run: |
make
diff -au <(gofmt -d *.go) <(printf "")
diff -au <(gofmt -s -d cmd) <(printf "")
diff -au <(gofmt -s -d pkg) <(printf "")
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 ./...
+1
View File
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build darwin
// +build darwin
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build solaris || openbsd
// +build solaris openbsd
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.
+5
View File
@@ -20,6 +20,7 @@ package cmd
import (
"context"
"os/exec"
"runtime"
"strings"
"testing"
"time"
@@ -421,6 +422,10 @@ func TestStringReplace(t *testing.T) {
// Tests exit status, getExitStatus() function
func TestGetExitStatus(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip("Skipping on non-linux")
return
}
testCases := []struct {
command string
expectedExitStatus int
+1
View File
@@ -1,3 +1,4 @@
//go:build !windows
// +build !windows
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build fips
// +build fips
package cmd
+1
View File
@@ -15,6 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//go:build !fips
// +build !fips
package cmd
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/minio/mc
go 1.14
go 1.16
require (
github.com/briandowns/spinner v1.16.0
-2
View File
@@ -1,5 +1,3 @@
// +build go1.13
// Copyright (c) 2015-2021 MinIO, Inc.
//
// This file is part of MinIO Object Storage stack
+1
View File
@@ -1,3 +1,4 @@
//go:build darwin
// +build darwin
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build linux
// +build linux
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build openbsd || solaris
// +build openbsd solaris
// Copyright (c) 2015-2021 MinIO, Inc.
+1
View File
@@ -1,3 +1,4 @@
//go:build windows
// +build windows
// Copyright (c) 2015-2021 MinIO, Inc.