ci: set up build & lint workflow

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I98f116b592535a5a1b97563b8e9d26da6a6a6964
This commit is contained in:
raf 2026-03-07 08:42:36 +03:00
commit c1033bed39
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF

44
.github/workflows/go.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Build & Test with Go
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Download dependencies
run: go mod download
- name: Run tests
run: go test -v -race ./...
- name: Build
run: go build . -o watchdog
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest