From 5bd7fc23de6377d37b0205c905b7f588e53e6070 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 2 Jun 2026 08:39:26 -0700 Subject: [PATCH] ci: add pr quality gate for golang --- .github/workflows/pr-quality-gate-golang.yml | 36 ++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pr-quality-gate-golang.yml diff --git a/.github/workflows/pr-quality-gate-golang.yml b/.github/workflows/pr-quality-gate-golang.yml new file mode 100644 index 0000000..ba673a5 --- /dev/null +++ b/.github/workflows/pr-quality-gate-golang.yml @@ -0,0 +1,36 @@ +name: Golang format and test + +on: + pull_request: + paths: + - "go/**" + branches: [ main ] + types: [ opened, synchronize, reopened ] + +jobs: + verify: + name: Verify + runs-on: ubuntu-latest + defaults: + run: + working-directory: js/go + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version-file: go/go.mod + cache-dependency-path: go/go.sum + + - name: Verify gofmt + run: | + if [ -n "$(gofmt -l .)" ]; then + echo "The following files are not formatted correctly:" + gofmt -l . + exit 1 + fi + + - name: Run tests + run: go test ./...