This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
Go Client CI #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
env: | |
# bors-ng fails to set ${GITHUB_BASE_REF} to the target PR branch which breaks go-apidiff | |
# so we use this fixed value as a workaround | |
GO_CLIENT_BASE_REF: stable/8.4 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
cache: true | |
cache-dependency-path: 'clients/go/go.sum' | |
# Fetching a shallow copy of the ${GITHUB_BASE_REF} branch to check the compatibility against | |
- name: Fetching Base Branch | |
run: | | |
git fetch --depth=1 origin ${{ env.GO_CLIENT_BASE_REF }} | |
- uses: joelanford/go-apidiff@main | |
with: | |
base-ref: origin/${{ env.GO_CLIENT_BASE_REF }} |