-
Notifications
You must be signed in to change notification settings - Fork 159
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
95-martin-orion
merged 4 commits into
quantumlib:master
from
dougthor42:u/dthor/bazelisk
Sep 17, 2024
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
86f9d92
Use bazel-contrib/setup-bazel instead of manually installing a deb du…
dougthor42 db188b3
Specify bazelisk-version in case bazelisk isn't installed in the CI c…
dougthor42 6296de3
/facepalm forgot the 'with:'
dougthor42 01cb1aa
Merge branch 'master' into u/dthor/bazelisk
dougthor42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,14 @@ 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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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 to5.3.0
.setup-bazel
will install bazelisk 1.x asbazel
and then any timebazel
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