fixes based on pr comments #18262
Workflow file for this run
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
| # Copyright 2021-Present Couchbase, Inc. | |
| # | |
| # Use of this software is governed by the Business Source License included in | |
| # the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that | |
| # file, in accordance with the Business Source License, use of this software | |
| # will be governed by the Apache License, Version 2.0, included in the file | |
| # licenses/APL2.txt. | |
| name: ci | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - 'master' | |
| - 'main' | |
| - 'release/*' | |
| - 'feature/*' | |
| - 'beryllium' | |
| - 'CBG*' | |
| - 'ci-*' | |
| pull_request: | |
| branches: | |
| - 'master' | |
| - 'main' | |
| - 'release/*' | |
| - 'beryllium' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ !contains(github.ref, 'release/') && !contains(github.ref, 'main') }} | |
| env: | |
| ACTIONS_CHECKOUT_VERSION: &actions_checkout_version actions/checkout@v6 | |
| ACTIONS_SETUP_GO_VERSION: &actions_setup_go_version actions/setup-go@v6 | |
| ACTIONS_RUFF_VERSION: &actions_ruff_version astral-sh/ruff-action@v4.0.0 | |
| GO_VERSION: &go_version 1.26.2 | |
| GOTESTSUM_VERSION: 1.13.0 | |
| GO_TEST_ANNOTATIONS_VERSION: &go_test_annotations_version guyarb/golang-test-annotations@v0.9.0 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: go-build | |
| run: go build "./..." | |
| addlicense: | |
| name: addlicense | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - run: go install github.com/google/addlicense@latest | |
| - run: addlicense -check -f licenses/addlicense.tmpl . | |
| golangci: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@v9 | |
| with: | |
| version: v2.11.4 | |
| args: --config=.golangci-strict.yml | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| name: macos | |
| - os: windows-latest | |
| name: windows | |
| - os: ubuntu-latest | |
| name: ubuntu | |
| env: | |
| GOPRIVATE: github.com/couchbaselabs | |
| MallocNanoZone: 0 | |
| name: test (${{ matrix.name }}) | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Build | |
| run: go build -v "./..." | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| test-race: | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPRIVATE: github.com/couchbaselabs | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -race -shuffle=on -timeout=30m -count=1 "./..." | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| test-default-collection: | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPRIVATE: github.com/couchbaselabs | |
| SG_TEST_USE_DEFAULT_COLLECTION: true | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| test-benchmark-compile: | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPRIVATE: github.com/couchbaselabs | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 -short -bench=. -benchtime=1x -run '!' "./..." | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| test-disable-rev-cache: | |
| runs-on: ubuntu-latest | |
| env: | |
| GOPRIVATE: github.com/couchbaselabs | |
| SG_TEST_DISABLE_REV_CACHE: true | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -tags cb_sg_devmode -shuffle=on -timeout=30m -count=1 "./..." | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| python-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_ruff_version | |
| with: | |
| args: 'format --check' | |
| python-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_ruff_version | |
| test-sgcollect: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Run test | |
| run: | | |
| uv run -- pytest | |
| - name: Run mypy | |
| run: | | |
| uv run -- mypy | |
| test-stats-definition-exporter: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Build | |
| run: go build -v "./tools/stats-definition-exporter" | |
| - name: Install gotestsum | |
| run: go install gotest.tools/gotestsum@v${{ env.GOTESTSUM_VERSION }} | |
| - name: Run Tests | |
| run: gotestsum --format pkgname-and-test-fails --hide-summary=output --jsonfile test.json -- -shuffle=on -timeout=5m -count=1 "./tools/stats-definition-exporter" | |
| shell: bash | |
| - name: Test Summary | |
| if: always() | |
| shell: bash | |
| run: .github/scripts/test-summary.sh | |
| - name: Annotate Failures | |
| if: always() | |
| uses: *go_test_annotations_version | |
| with: | |
| test-results: test.json | |
| cache_perf_tool_build: | |
| runs-on: ubuntu-latest | |
| name: build cache perf tool | |
| steps: | |
| - uses: *actions_checkout_version | |
| - uses: *actions_setup_go_version | |
| with: | |
| go-version: *go_version | |
| - name: Build | |
| run: go build "./tools/cache_perf_tool" | |
| govulncheck: | |
| runs-on: ubuntu-latest | |
| name: Run govulncheck | |
| steps: | |
| - id: govulncheck | |
| uses: golang/govulncheck-action@v1 | |
| with: | |
| go-version-input: *go_version | |
| go-package: ./... |