Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bazel-contrib/setup-bazel instead of manually installing a deb during CI #665

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions .github/workflows/bazeltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: bazel-contrib/[email protected]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not immediately clear to me how (or if) this specifies the bazel version to install. IIRC, this is important for qsim as it needs to align with the bazel version used in TFQ for compatibility reasons.

Can we lock the bazel version to 5.3.0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bazel version is locked by .bazelversion in the root of the repo, and that's already set to 5.3.0.

setup-bazel will install bazelisk 1.x as bazel and then any time bazel is called, bazelisk will download and install the bazel version defined by .bazelversion if the file exists (which it does 🙃)

More info on how bazelisk determines which version of bazel to run can be found here: https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#how-does-bazelisk-know-which-bazel-version-to-run

with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
Expand All @@ -51,16 +53,18 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
- name: Upgrade libc
- name: Upgrade libc
# An LLVM update broke this test, fix per is https://bugs.llvm.org/show_bug.cgi?id=27310.
run: |
sudo apt update
Expand All @@ -69,19 +73,21 @@ jobs:
run: |
bazel test --config=avx --config=openmp \
--config=${{ matrix.sanitizer_opt }} tests:all

test-mem:
name: Test with tcmalloc
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
bazelisk-version: 1.x
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Install Bazel on CI
run: |
wget https://github.com/bazelbuild/bazel/releases/download/5.3.0/bazel_5.3.0-linux-x86_64.deb
sudo dpkg -i bazel_5.3.0-linux-x86_64.deb
- name: Install requirements
run: |
python3 -m pip install -r requirements.txt
Expand Down
Loading