github.com/alimy/mir/v4@v4.1.0/.github/workflows/go.yml (about)

     1  name: Go
     2  on:
     3    push:
     4      branches:
     5        - main
     6        - 'v3'
     7        - 'v4'
     8      paths:
     9        - '**.go'
    10        - 'go.mod'
    11        - '.golangci.yml'
    12        - '.github/workflows/go.yml'
    13    pull_request:
    14      paths:
    15        - '**.go'
    16        - 'go.mod'
    17        - '.golangci.yml'
    18        - '.github/workflows/go.yml'
    19  env:
    20    GOPROXY: "https://proxy.golang.org"
    21  
    22  permissions:
    23    contents: read
    24  
    25  jobs:
    26    # lint:
    27    #   permissions:
    28    #     contents: read       # for actions/checkout to fetch code
    29    #     pull-requests: read  # for golangci/golangci-lint-action to fetch pull requests
    30    #   name: Lint
    31    #   runs-on: ubuntu-latest
    32    #   steps:
    33    #     - name: Checkout code
    34    #       uses: actions/checkout@v3
    35    #     - name: Run golangci-lint
    36    #       uses: golangci/golangci-lint-action@v3
    37    #       with:
    38    #         version: latest
    39    #         args: --timeout=30m
    40  
    41    test:
    42      name: Test
    43      strategy:
    44        matrix:
    45          go-version: [1.19.x, 1.20.x ]
    46          platform: [ ubuntu-latest, macos-latest ]
    47      runs-on: ${{ matrix.platform }}
    48      steps:
    49        - name: Install Go
    50          uses: actions/setup-go@v3
    51          with:
    52            go-version: ${{ matrix.go-version }}
    53        - name: Checkout code
    54          uses: actions/checkout@v3
    55        - name: Run tests
    56          run: go test -v -race ./...
    57        
    58    # Running tests with race detection consumes too much memory on Windows,
    59    # see https://github.com/golang/go/issues/46099 for details.
    60    test-windows:
    61      name: TestOnWindows
    62      strategy:
    63        matrix:
    64          go-version: [ 1.19.x, 1.20.x ]
    65          platform: [ windows-latest ]
    66      runs-on: ${{ matrix.platform }}
    67      steps:
    68        - name: Install Go
    69          uses: actions/setup-go@v3
    70          with:
    71            go-version: ${{ matrix.go-version }}
    72        - name: Checkout code
    73          uses: actions/checkout@v3
    74        - name: Run tests
    75          run: go test -v ./...