revert: "ci: use go version matrix" #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: read | |
checks: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Install golines | |
run: | | |
go install github.com/segmentio/golines@v0.12.2 | |
go install golang.org/x/tools/cmd/goimports@v0.25.0 | |
- name: Check format | |
run: | | |
if [-n "$(golines --base-formatter goimports -l .)" ]; then | |
echo "The following files are not formatted:" | |
golines -l . | |
exit 1 | |
fi | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.59 | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test | |
run: go test -v -race --covermode=atomic --coverprofile=coverage.out ./... | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Build | |
run: go build -v main.go | |