From 77dbd9e539eafc479b735f6783d9b197fb4714b7 Mon Sep 17 00:00:00 2001 From: "Meggle (Sebastian Bathke)" Date: Sun, 8 Sep 2024 09:45:02 +0200 Subject: [PATCH] ci: add ci workflow --- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..cdd3c9d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: Go Client CI +on: + push: + branches: main + 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: + # fixed to avoid triggering false positive; see https://github.com/golangci/golangci-lint-action/issues/535 + version: v1.55.2 + # caching issues, see: https://github.com/golangci/golangci-lint-action/issues/244#issuecomment-1052190775 + skip-pkg-cache: true + skip-build-cache: true + working-directory: . + go-apidiff: + name: Go Backward Compatibility + 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' + - uses: joelanford/go-apidiff@main