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.
Github actions Templte CI for go
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 ./...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment