Repository navigation
generated clients #41
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
| # This workflow runs basic CI checks for the repository: | |
| # - Unit tests | |
| # - Linting | |
| # - Formatting | |
| # | |
| # It is not responsible for running integration tests or other tests that are | |
| # more complex to run in a CI environment. | |
| name: ci | |
| on: | |
| pull_request: | |
| types: [opened, synchronize] | |
| merge_group: | |
| types: [checks_requested] | |
| push: | |
| # Always run on push to main. The build cache can only be reused | |
| # if it was saved by a run from the repository's default branch. | |
| # The run result will be identical to that from the merge queue | |
| # because the commit is identical, yet we need to perform it to | |
| # seed the build cache. | |
| branches: | |
| - main | |
| jobs: | |
| discover: | |
| runs-on: linux-ubuntu-latest | |
| outputs: | |
| modules: ${{ steps.find.outputs.modules }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Find modules | |
| id: find | |
| run: | | |
| modules=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^\./||' | sort | jq -Rnc '[inputs]') | |
| echo "modules=$modules" >> $GITHUB_OUTPUT | |
| tests: | |
| needs: discover | |
| runs-on: linux-ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go-version: | |
| - "1.25" | |
| # - "1.26" | |
| module: ${{ fromJson(needs.discover.outputs.modules) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Run tests | |
| working-directory: ${{ matrix.module }} | |
| # Only run tests if there are any packages to test. | |
| run: go list ./... | xargs -r go test -v -race | |
| lint: | |
| needs: discover | |
| runs-on: linux-ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| module: ${{ fromJson(needs.discover.outputs.modules) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| - name: Run golangci-lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: latest | |
| install-mode: goinstall | |
| working-directory: ${{ matrix.module }} | |
| args: --timeout=5m ./... | |
| fmt: | |
| runs-on: linux-ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.25" | |
| cache: false | |
| - name: Run gofmt | |
| run: gofmt -l -w . | |
| - name: Fail on differences | |
| run: git diff --exit-code |