fix(scripts): Change target names in run_tests script #110
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 2025 Google LLC | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Bazel Build and Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| permissions: read-all # Needed for security checks, adjust if necessary | |
| jobs: | |
| build_and_test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| # Bazel needs a JDK. Setup Java 11 as required by the tests. | |
| - name: Setup Java JDK 11 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '11' | |
| # Set up Go environment for go install | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24.2' | |
| # Use bazelisk to manage Bazel versions based on .bazelversion | |
| - name: Install Bazelisk via Go | |
| run: go install github.com/bazelbuild/bazelisk@latest | |
| - name: Mount Bazel repository cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/bazel/_bazel_${{ runner.os }}/repos | |
| ~/.cache/bazel/_bazel_${{ runner.os }}/external | |
| key: bazel-repo-${{ hashFiles('**/MODULE.bazel.lock', '**/maven_install.json', '**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| bazel-repo- | |
| # Setup Bazel action cache | |
| # Caching build results can significantly speed up CI. | |
| # Be cautious with cache size and eviction. | |
| - name: Mount Bazel action cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/bazel/_bazel_${{ runner.os }}/execroot/**/bazel-out | |
| key: bazel-action-${{ github.sha }}-${{ hashFiles('**/MODULE.bazel.lock', '**/maven_install.json', '**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| bazel-action-${{ github.ref }}-${{ hashFiles('**/MODULE.bazel.lock', '**/maven_install.json', '**/pnpm-lock.yaml') }} | |
| bazel-action- | |
| - name: Build all targets | |
| run: bazelisk build //... | |
| - name: Test all targets | |
| # --test_output=errors only shows logs for failed tests | |
| run: bazelisk test //... --test_output=errors |