Skip to content

Commit

Permalink
feat: Add CI workflow
Browse files Browse the repository at this point in the history
Added a new CI workflow for Github Actions that will vet, and lint the
code and run the test suite.
Linting is done with golangci-lint. Tests are run against all Go
versions from 1.16 onwards.
  • Loading branch information
gkats committed Jan 30, 2024
1 parent ecebb51 commit e9c8f01
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI

on:
pull_request:
push:
branches:
- $default-branch
- v2

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Format
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: Vet
run: go vet ./...
- name: Run linter
uses: golangci/golangci-lint-action@v3
test:
name: "Test: go v${{ matrix.go-version }}"
strategy:
matrix:
go-version:
- "1.16"
- "1.17"
- "1.18"
- "1.19"
- "1.20"
- "1.21"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: go test -v -race ./...

0 comments on commit e9c8f01

Please sign in to comment.