ci: add CI and release workflows for automated builds
CI / Test (push) Successful in 25s
CI / Build (push) Successful in 31s

This commit is contained in:
Hein
2026-06-29 09:02:56 +02:00
parent 531087bfed
commit 2bee0e1ed9
2 changed files with 427 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
name: CI
run-name: "CI"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Vet
run: go vet ./...
- name: Test
run: go test ./...
- name: Format check
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "Files need gofmt:"
echo "$unformatted"
exit 1
fi
build:
name: Build
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build binary
run: |
CGO_ENABLED=0 go build -trimpath -o pgtidy ./cmd/pgtidy
echo "Build successful:"
ls -lh pgtidy