github.com/meowstercatel/discordgo@v0.0.0-20250615204139-29b43d676735/.github/workflows/ci.yml (about)

     1  on:
     2    push:
     3    pull_request:
     4  
     5  name: CI
     6  
     7  jobs:
     8    format:
     9      runs-on: ubuntu-latest
    10      steps:
    11        - name: Install Go
    12          uses: actions/setup-go@v3
    13          with:
    14            go-version: 1.18
    15        - name: Code
    16          uses: actions/checkout@v3
    17        - name: Check diff between gofmt and code
    18          run: diff <(gofmt -d .) <(echo -n)
    19    
    20    test:
    21      runs-on: ubuntu-latest
    22      strategy:
    23        matrix:
    24          go-version: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
    25      steps:
    26        - name: Install Go
    27          uses: actions/setup-go@v3
    28          with:
    29            go-version: ${{ matrix.go-version }}
    30        - name: Code
    31          uses: actions/checkout@v3
    32        - run: go test -v -race ./...
    33    
    34    lint:
    35      runs-on: ubuntu-latest
    36      steps:
    37        - name: Install Go
    38          uses: actions/setup-go@v3
    39          with:
    40            go-version: 1.18
    41        - name: Code
    42          uses: actions/checkout@v3
    43        - name: Go vet
    44          run: go vet -x ./...
    45  
    46        - name: GolangCI-Lint
    47          uses: golangci/golangci-lint-action@v3
    48          if: github.event.name == 'pull_request'
    49          with:
    50            only-new-issues: true
    51            skip-pkg-cache: true
    52            skip-build-cache: true
    53        
    54        - name: GolangCI-Lint
    55          if: github.event.name != 'pull_request' # See https://github.com/golangci/golangci-lint-action/issues/362
    56          run: |
    57            curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
    58  
    59            $(go env GOPATH)/bin/golangci-lint run
    60