Skip to content

Commit

Permalink
Add Bazel remote caching
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoeppe committed Jul 20, 2023
1 parent fdf60bc commit e53a59e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/make_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
env:
CC: ${{ matrix.cfg.cc }}
CXX: ${{ matrix.cfg.cxx }}
GCP_KEY: ${{ secrets.GCP_KEY }}
WHEEL_NAME: ''

steps:
Expand All @@ -68,10 +69,13 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install Python Dependencies
run: pip3 install --upgrade pip packaging check-wheel-contents
run: |
pip3 install --upgrade pip packaging check-wheel-contents
echo "${GCP_KEY}" | base64 -d > "${HOME}/gcp_key.json"
- name: Build for Python ${{ matrix.python-version }}
run: bazel --bazelrc=.bazelrc build --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel
id: build_wheel
run: bazel --bazelrc=.bazelrc build --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --compilation_mode=opt --dynamic_mode=off --config=luajit ${{ matrix.cfg.config }} //dmlab2d:dmlab2d_wheel

- name: Get built wheel name
working-directory: bazel-bin/dmlab2d
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
GCP_KEY: ${{ secrets.GCP_KEY }}

steps:
- uses: actions/checkout@v3
Expand All @@ -45,40 +46,43 @@ jobs:
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install python3-dev python3-numpy python3-packaging
echo "${GCP_KEY}" | base64 -d > "${HOME}/gcp_key.json"
sudo ln -s /usr/lib/llvm-10/include/c++/v1 /usr/include/c++/v1
- name: install infrastructure (MacOS)
if: matrix.os == 'macos-12' || matrix.os == 'macos-13'
run: sudo -H pip3 install numpy packaging
run: |
sudo -H pip3 install numpy packaging
echo "${GCP_KEY}" | base64 -d > "${HOME}/gcp_key.json"
- name: build-lua5.1
run: |
bazel --bazelrc=.bazelrc build --config=lua5_1 ${{ matrix.config }} //...
bazel --bazelrc=.bazelrc build --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=lua5_1 ${{ matrix.config }} //...
- name: test-lua5.1
if: (!contains(matrix.config, 'arm64'))
run: |
bazel --bazelrc=.bazelrc test --config=lua5_1 ${{ matrix.config }} --test_output=errors //...
bazel --bazelrc=.bazelrc test --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=lua5_1 ${{ matrix.config }} --test_output=errors //...
- name: build-lua5.2
run: |
bazel --bazelrc=.bazelrc build --config=lua5_2 ${{ matrix.config }} //...
bazel --bazelrc=.bazelrc build --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=lua5_2 ${{ matrix.config }} //...
- name: test-lua5.2
if: (!contains(matrix.config, 'arm64'))
run: |
bazel --bazelrc=.bazelrc test --config=lua5_2 ${{ matrix.config }} --test_output=errors //...
bazel --bazelrc=.bazelrc test --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=lua5_2 ${{ matrix.config }} --test_output=errors //...
- name: build-luajit
run: |
bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} //...
bazel --bazelrc=.bazelrc build --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=luajit ${{ matrix.config }} //...
- name: test-luajit
if: (!contains(matrix.config, 'arm64'))
run: |
bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --test_output=errors //...
bazel --bazelrc=.bazelrc test --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=luajit ${{ matrix.config }} --test_output=errors //...
- name: build-luajit-internal_unwind
run: |
bazel --bazelrc=.bazelrc build --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False //...
bazel --bazelrc=.bazelrc build --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False //...
- name: test-luajit-internal_unwind
if: (!contains(matrix.config, 'arm64'))
run: |
bazel --bazelrc=.bazelrc test --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False --test_output=errors //...
bazel --bazelrc=.bazelrc test --remote_cache="https://storage.googleapis.com/dmlab-travis-cache" --google_credentials="${HOME}/gcp_key.json" --config=luajit ${{ matrix.config }} --copt=-fno-asynchronous-unwind-tables --luajit_external_unwinder=False --test_output=errors //...

0 comments on commit e53a59e

Please sign in to comment.