github.com/jxskiss/gopkg/v2@v2.14.9-0.20240514120614-899f3e7952b4/.github/workflows/ci.yml (about)

     1  name: CI
     2  
     3  on:
     4    push:
     5      branches: [ master, main ]
     6    pull_request:
     7      branches: [ master, main ]
     8  
     9  jobs:
    10  
    11    build:
    12      name: Build
    13      runs-on: ubuntu-latest
    14  
    15      steps:
    16        - name: Set up Go
    17          uses: actions/setup-go@v3
    18          with:
    19            go-version: ^1.19
    20  
    21        - name: Check out code
    22          uses: actions/checkout@v3
    23  
    24        - name: Get dependencies
    25          run: go get -v -t -d ./...
    26  
    27        - name: Build
    28          run: go build -v ./...
    29  
    30    test:
    31      name: Test
    32      runs-on: ${{ matrix.os }}
    33      strategy:
    34        # Fail fast is disabled because there are Go version specific features and tests
    35        # that should be able to fail independently.
    36        fail-fast: false
    37        matrix:
    38          os: [ ubuntu-latest, macos-latest, windows-latest ]
    39          go: [ '1.19', '1.20', '1.21', '1.22' ]
    40      env:
    41        GOFLAGS: -mod=readonly
    42  
    43      steps:
    44        - name: Set up Go
    45          uses: actions/setup-go@v3
    46          with:
    47            go-version: ${{ matrix.go }}
    48  
    49        - name: Checkout code
    50          uses: actions/checkout@v3
    51  
    52        - name: Test
    53          run: go test -race -v ./...
    54  
    55    lint:
    56      name: Lint
    57      runs-on: ubuntu-latest
    58      env:
    59        GOFLAGS: -mod=readonly
    60  
    61      steps:
    62        - name: Set up Go
    63          uses: actions/setup-go@v3
    64          with:
    65            go-version: ^1.19
    66  
    67        - name: Checkout code
    68          uses: actions/checkout@v3
    69  
    70        - name: Lint
    71          uses: golangci/golangci-lint-action@v3
    72          with:
    73            version: v1.55.2
    74            only-new-issues: true