From a699202d17460848f1034508e9778d9bf4d06854 Mon Sep 17 00:00:00 2001 From: Tristan Vuong <85768771+tristanvuong2021@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:51:28 -0700 Subject: [PATCH] fix: Add lockfile check to presubmit workflow (#265) fix: Add lockfile check to presubmit workflow --- .github/workflows/build-test.yml | 18 ++++++++++++------ MODULE.bazel.lock | 28 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index f3169f6c6..206bca8ab 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -28,7 +28,10 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Check out revision - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up Bazel + uses: world-federation-of-advertisers/actions/setup-bazel@v2 - name: Write ~/.bazelrc run: | @@ -41,30 +44,33 @@ jobs: cache-version: 1 - name: Restore Bazel cache - uses: actions/cache/restore@v3 + uses: actions/cache/restore@v4 with: path: ${{ steps.get-cache-params.outputs.cache-path }} key: ${{ steps.get-cache-params.outputs.cache-key }} restore-keys: |- ${{ steps.get-cache-params.outputs.restore-key }} + - name: Check lockfile + run: bazel mod deps + - name: Build - run: bazelisk build //... + run: bazel build //... - name: Run tests id: run-tests - run: bazelisk test //... + run: bazel test //... # Delete large files that are relatively cheap to re-create. - name: Trim Bazel cache run: | - bazel_out="$(bazelisk info output_path)" + bazel_out="$(bazel info output_path)" find "${bazel_out}" -type f \( -iname '*.tar' -o -iname '*.tar.gz' \) -delete find "${bazel_out}" -type d -name sha256 -exec chmod -R +w "{}" \; find "${bazel_out}" -type f -path '*/sha256/*' -delete - name: Save Bazel cache - uses: actions/cache/save@v3 + uses: actions/cache/save@v4 continue-on-error: true with: path: ${{ steps.get-cache-params.outputs.cache-path }} diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index 44507c710..6c788130e 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -2646,6 +2646,34 @@ ] } }, + "@@bazel_tools//tools/android:android_extensions.bzl%remote_android_tools_extensions": { + "general": { + "bzlTransitiveDigest": "4x/FXzwoadac6uV9ItZ4eGOyCculGHHrKUhLFNWo3lA=", + "accumulatedFileDigests": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "android_tools": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "name": "bazel_tools~remote_android_tools_extensions~android_tools", + "sha256": "2b661a761a735b41c41b3a78089f4fc1982626c76ddb944604ae3ff8c545d3c2", + "url": "https://mirror.bazel.build/bazel_android_tools/android_tools_pkg-0.30.0.tar" + } + }, + "android_gmaven_r8": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_jar", + "attributes": { + "name": "bazel_tools~remote_android_tools_extensions~android_gmaven_r8", + "sha256": "57a696749695a09381a87bc2f08c3a8ed06a717a5caa3ef878a3077e0d3af19d", + "url": "https://maven.google.com/com/android/tools/r8/8.1.56/r8-8.1.56.jar" + } + } + }, + "recordedRepoMappingEntries": [] + } + }, "@@bazel_tools//tools/cpp:cc_configure.bzl%cc_configure_extension": { "general": { "bzlTransitiveDigest": "mcsWHq3xORJexV5/4eCvNOLxFOQKV6eli3fkr+tEaqE=",