name: "Test Bazel Build" on: push: branches: [ main ] pull_request: branches: [ main ] schedule: - cron: "0 0 * * *" jobs: build: runs-on: ubuntu-22.04 env: BAZEL: bazelisk-linux-amd64 steps: - uses: actions/checkout@v5 with: submodules: recursive - name: Mount bazel cache uses: actions/cache@v4 with: # See https://docs.bazel.build/versions/master/output_directories.html path: "~/.cache/bazel" # Create a new cache entry whenever Bazel files change. # See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows key: bazel-${{ runner.os }}-build-${{ hashFiles('**/*.bzl', '**/*.bazel') }} restore-keys: | bazel-${{ runner.os }}-build- - name: Install bazelisk run: | curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.15.0/$BAZEL" chmod +x $BAZEL sudo mv $BAZEL /usr/local/bin/bazel - name: Build and run tests run: bazel test //proto/tests:pi_proto_tests //proto/tests:pi_proto_server_tests