Skip to content

ci: add unit tests workflow and fix broken tests (#209) #4

ci: add unit tests workflow and fix broken tests (#209)

ci: add unit tests workflow and fix broken tests (#209) #4

Workflow file for this run

name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
golangci-lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.64
args: --timeout=5m
go-fmt:
name: go fmt
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Check formatting
run: |
if [ -n "$(gofmt -l .)" ]; then
echo "The following files are not formatted:"
gofmt -l .
exit 1
fi
go-vet:
name: go vet
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run go vet
run: go vet ./...