github.com/minio/madmin-go/v3@v3.0.51/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on:
     4    pull_request:
     5      branches:
     6      - main
     7      - master
     8  
     9    push:
    10      branches:
    11      - main
    12      - master
    13  
    14  jobs:
    15    build:
    16      name: Lint checks Go ${{ matrix.go-version }}
    17      runs-on: ubuntu-latest
    18      strategy:
    19        matrix:
    20          go-version: [1.21.x]
    21      steps:
    22      - name: Set up Go ${{ matrix.go-version }}
    23        uses: actions/setup-go@v1
    24        with:
    25          go-version: ${{ matrix.go-version }}
    26        id: go
    27  
    28      - name: Check out code into the Go module directory
    29        uses: actions/checkout@v1
    30  
    31      - name: Build
    32        run: |
    33           curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
    34           $(go env GOPATH)/bin/golangci-lint run --config ./.golangci.yml
    35           go vet ./...
    36           go install -v github.com/tinylib/msgp@latest
    37           go install -v golang.org/x/tools/cmd/stringer@latest
    38           export PATH=${PATH}:$(go env GOPATH)/bin
    39           go generate ./... >/dev/null
    40           (! git diff --name-only | grep '_gen.go$$') || (echo "Non-committed changes in auto-generated code is detected, please commit them to proceed." && false)
    41  
    42    test:
    43      name: Testing Go ${{ matrix.go-version }} on ${{ matrix.os }}
    44      runs-on: ${{ matrix.os }}
    45      strategy:
    46        matrix:
    47          go-version: [1.21.x]
    48          os: [ubuntu-latest, windows-latest, macos-latest]
    49      steps:
    50      - name: Set up Go ${{ matrix.go-version }} on ${{ matrix.os }}
    51        uses: actions/setup-go@v1
    52        with:
    53          go-version: ${{ matrix.go-version }}
    54        id: go
    55  
    56      - name: Check out code into the Go module directory
    57        uses: actions/checkout@v1
    58  
    59      - name: Test on ${{ matrix.os }}
    60        if: matrix.os == 'ubuntu-latest'
    61        run: |
    62           go test -v -race ./...
    63           GOARCH=386 GOOS=linux go test -v ./...
    64  
    65      - name: Test on ${{ matrix.os }}
    66        if: matrix.os != 'ubuntu-latest'
    67        run: |
    68           go test -v -race ./...
    69  
    70  
    71