watchdog/.github/workflows/go.yml
NotAShelf ad50debb62
ci: only trigger test workflow when relevant files change
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ideee10cc79f6d3a3d542b5ae6bc375156a6a6964
2026-03-07 11:40:18 +03:00

57 lines
1 KiB
YAML

name: Build & Test with Go
on:
push:
branches: [main]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/go.yml'
- 'testdata/**'
pull_request:
branches: [main]
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- '.github/workflows/go.yml'
- 'testdata/**'
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