From 0628a915b4abe23718ed29b479d0419baadc7a8a Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Tue, 10 Nov 2026 12:37:43 +0100 Subject: [PATCH] go: Common Go Check Add a generic GitHub Actions Workflow to build and test all our Go code. It is based the IGL, Icinga DB, Icinga Notifications, and Icinga for K8s. --- .github/workflows/go.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..6ad370b --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,36 @@ +on: + workflow_call: + +permissions: + contents: read + +jobs: + go: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Setup Go + uses: actions/setup-go@v7 + with: + go-version: stable + + - name: Build + run: go build ./... + + - name: Test + run: go test -v -race ./... + + - name: golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: latest + + - name: gofmt + run: test -z "$(gofmt -d . | tee /dev/stderr)" + + - name: go mod tidy + run: go mod tidy -diff