-
Notifications
You must be signed in to change notification settings - Fork 553
82 lines (74 loc) · 2.54 KB
/
go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Go
on:
pull_request:
branches:
- master
# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build:
name: Test on Go ${{ matrix.go-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- 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'
env:
ACCESS_KEY: minioadmin
SECRET_KEY: minioadmin
ENABLE_HTTPS: 1
MINIO_CI_CD: 1
SERVER_ENDPOINT: localhost:9000
MC_TEST_ENABLE_HTTPS: true
MC_TEST_SKIP_INSECURE: true
MC_TEST_SKIP_BUILD: true
run: |
wget https://dl.min.io/server/minio/release/linux-amd64/minio && chmod +x minio
mkdir -p ~/.minio/certs/ && cp testdata/localhost.crt ~/.minio/certs/public.crt && cp testdata/localhost.key ~/.minio/certs/private.key
sudo cp testdata/localhost.crt /usr/local/share/ca-certificates/ && sudo update-ca-certificates
./minio server /tmp/test-xl/{1...4}/ & sleep 10
make
make test-race
make verify
./functional-tests.sh
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.22.x
- name: Checkout code
uses: actions/checkout@v2
- name: Test 386
run: GOOS=linux GOARCH=386 go test -short ./...
- name: Staticcheck
# Run with defaults, but allow errors with other formats ST1005
run: go install honnef.co/go/tools/cmd/staticcheck@latest && make lint