Skip to content

Instantly share code, notes, and snippets.

@aikchun
Created May 21, 2023 09:15
Show Gist options
  • Save aikchun/18c546ad3485e9e2eedbad7c801acfc8 to your computer and use it in GitHub Desktop.
Save aikchun/18c546ad3485e9e2eedbad7c801acfc8 to your computer and use it in GitHub Desktop.

Revisions

  1. aikchun created this gist May 21, 2023.
    37 changes: 37 additions & 0 deletions go-ci.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,37 @@
    name: CI

    on:
    push:
    branches: [main]
    pull_request:
    branches: [main]

    jobs:

    unittest:
    runs-on: ubuntu-22.04
    steps:
    - uses: actions/checkout@v3

    - name: Set up Go
    uses: actions/setup-go@v4
    with:
    go-version: '>=1.20.0'

    - name: Verify dependencies
    run: go mod verify

    - name: Build
    run: go build -v ./...

    - name: Run go vet
    run: go vet ./...

    - name: Install golint
    run: go install golang.org/x/lint/golint@latest

    - name: Run golint
    run: golint ./...

    - name: Run tests
    run: go test -race -vet=off ./...