Release go-sdk #10
This file contains hidden or 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
| # Continuous Integration for the go-sdk. | |
| # | |
| # Runs build, vet, format check and tests, plus a cross-compile matrix across | |
| # every OS/arch consumers ship on. The cross-compile job exists specifically to | |
| # catch platform-portability regressions (e.g. Unix-only syscalls) at the | |
| # source, before they reach downstream binaries. | |
| # | |
| # Scope matches the Makefile's PACKAGES (library packages only). The examples/ | |
| # tree is excluded because some examples depend on generated, gitignored files | |
| # (e.g. portable-embedded-agent/secrets_gen.go). | |
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| pull_request: | |
| branches: | |
| - main | |
| - next | |
| paths-ignore: | |
| - '**.md' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| permissions: | |
| contents: read | |
| env: | |
| PACKAGES: ./sdk/... ./agent/... ./types/... ./internal/... | |
| jobs: | |
| check: | |
| name: Build, Vet & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Vet | |
| run: make vet | |
| - name: Format check | |
| run: make fmt-check | |
| - name: Test | |
| run: make test | |
| - name: Build | |
| run: go build ${{ env.PACKAGES }} | |
| cross-compile: | |
| name: Cross-compile (${{ matrix.goos }}/${{ matrix.goarch }}) | |
| runs-on: ubuntu-latest | |
| needs: check | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| - goos: windows | |
| goarch: amd64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| cache: true | |
| - name: Cross-compile | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: '0' | |
| run: go build ${{ env.PACKAGES }} |