Skip to content

Commit

Permalink
fix: Add lockfile check to presubmit workflow (#265)
Browse files Browse the repository at this point in the history
fix: Add lockfile check to presubmit workflow
  • Loading branch information
tristanvuong2021 authored Aug 19, 2024
1 parent 880d5c8 commit a699202
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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 }}
Expand Down
28 changes: 28 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a699202

Please sign in to comment.