github.com/moitias/moq@v0.0.0-20240223074357-5eb0f0ba4054/.github/workflows/test.yml (about)

     1  name: build
     2  
     3  on:
     4    push:
     5      tags: [v*]
     6      branches: [main]
     7    pull_request:
     8  
     9  jobs:
    10    # See https://github.com/mvdan/github-actions-golang
    11    test:
    12      runs-on: ${{ matrix.os }}
    13  
    14      strategy:
    15        matrix:
    16          os: [ubuntu-latest]
    17          go-version: [1.18.x, 1.19.x]
    18          # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-expanding-configurations
    19          include:
    20            - os: windows-latest
    21              go-version: 1.19.x
    22            - os: macos-latest
    23              go-version: 1.19.x
    24  
    25      steps:
    26        - name: Checkout code
    27          uses: actions/checkout@v3
    28  
    29        - name: Install Go
    30          uses: actions/setup-go@v3
    31          with:
    32            go-version: ${{ matrix.go-version }}
    33            cache: true
    34  
    35        - name: Go install moq
    36          run: go install
    37  
    38        - name: Run vet
    39          if: matrix.os == 'ubuntu-latest'
    40          run: go vet ./...
    41  
    42        - name: Lint
    43          if: matrix.os == 'ubuntu-latest'
    44          run: |
    45            go install golang.org/x/lint/golint@latest
    46            golint ./...
    47  
    48        - name: Test
    49          run: go test ./...