diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..e2d6831a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,54 @@ +name: Go Client CI +on: + push: + branches: main + pull_request: { } + workflow_dispatch: { } +jobs: + go-client: + name: Go client tests + runs-on: ubuntu-latest + timeout-minutes: 20 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + cache-dependency-path: 'go.sum' + - name: Build Go + shell: bash + id: build-go + working-directory: cmd/zbctl + run: ./build.sh + - name: Run Go tests + working-directory: . + run: go test -mod=vendor -v ./... + go-lint: + name: Go linting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + cache-dependency-path: 'clients/go/go.sum' + - name: golangci-lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.60 + go-apidiff: + if: github.event_name == 'pull_request' + name: Go Backwards Compatibility + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + cache-dependency-path: 'clients/go/go.sum' + - uses: joelanford/go-apidiff@main