Update Go dependencies #2545
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
| name: CI | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, labeled] | |
| merge_group: | |
| schedule: | |
| # Every day at 10:09 UTC. | |
| - cron: '9 10 * * *' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| buildifier_check: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Generate BuildBuddy bazelrc | |
| uses: ./.github/actions/generate-buildbuddy-bazelrc | |
| with: | |
| template-path: .github/workflows/.bazelrc.buildbuddy | |
| output-path: .github/workflows/.bazelrc.buildbuddy.generated | |
| api-key: ${{ secrets.BUILDBUDDY_API_KEY }} | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelrc: | | |
| import %workspace%/.github/workflows/ci.bazelrc | |
| import %workspace%/.github/workflows/.bazelrc.buildbuddy.generated | |
| - name: Run buildifier | |
| run: bazelisk run //util:buildifier.check | |
| tidy_and_test_matrix: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [macos-15-intel, macos-15, ubuntu-22.04, windows-2025] | |
| runs-on: ${{ matrix.runner }} | |
| if: ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }} | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Generate BuildBuddy bazelrc | |
| uses: ./.github/actions/generate-buildbuddy-bazelrc | |
| with: | |
| template-path: .github/workflows/.bazelrc.buildbuddy | |
| output-path: .github/workflows/.bazelrc.buildbuddy.generated | |
| api-key: ${{ secrets.BUILDBUDDY_API_KEY }} | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| repository-cache: true | |
| bazelrc: | | |
| import %workspace%/.github/workflows/ci.bazelrc | |
| import %workspace%/.github/workflows/.bazelrc.buildbuddy.generated | |
| - name: Execute Tests | |
| run: bazelisk test //... @rules_img_tool//... @rules_img_pull_tool//... | |
| integration_test_matrix: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| runner: [macos-15-intel, macos-15, ubuntu-22.04, windows-2025] | |
| runs-on: ${{ matrix.runner }} | |
| if: ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| id-token: write | |
| contents: read | |
| packages: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Generate BuildBuddy bazelrc | |
| uses: ./.github/actions/generate-buildbuddy-bazelrc | |
| with: | |
| template-path: .github/workflows/.bazelrc.buildbuddy | |
| output-path: .github/workflows/.bazelrc.buildbuddy.generated | |
| api-key: ${{ secrets.BUILDBUDDY_API_KEY }} | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@c5acdfb288317d0b5c0bbd7a396a3dc868bb0f86 # 0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| repository-cache: true | |
| bazelrc: | | |
| import %workspace%/.github/workflows/ci.bazelrc | |
| import %workspace%/.github/workflows/.bazelrc.buildbuddy.generated | |
| - name: Execute Integration Tests | |
| shell: bash | |
| env: | |
| MSYS_NO_PATHCONV: 1 | |
| run: bazelisk test '//e2e:integration_tests' --test_env=BAZEL_INTEGRATION_TEST_INJECT_BAZELRC="${PWD}/.github/workflows/.bazelrc.buildbuddy.generated" --sandbox_add_mount_pair="${PWD}/.github/workflows/.bazelrc.buildbuddy.generated" | |
| all-tests-passed: | |
| runs-on: ubuntu-latest | |
| needs: [buildifier_check, tidy_and_test_matrix, integration_test_matrix] | |
| if: always() | |
| steps: | |
| - name: Check all jobs succeeded | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "One or more required jobs failed or were cancelled" | |
| exit 1 | |
| fi | |
| echo "All required jobs passed successfully" |