Internal change. #933
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
name: "linux" | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test-ubuntu: | |
name: Build and Test (Ubuntu) | |
runs-on: ubuntu-latest | |
env: | |
BAZEL: bazelisk-linux-amd64 | |
USE_BAZEL_VERSION: 6.4.0 | |
CC: gcc-9 | |
CXX: g++-9 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- name: Free up some space in an image | |
run: | | |
# This doesn't seem to affect the speed of the run, but takes ~2 minutes, | |
# commented out for now. | |
#sudo rm -rf /usr/share/dotnet | |
#sudo rm -rf /opt/ghc | |
df -h | |
- name: Mount bazel cache | |
uses: actions/cache@v3 | |
with: | |
# See https://docs.bazel.build/versions/master/output_directories.html | |
path: "~/.cache/bazel" | |
key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE.bazel') }} | |
restore-keys: ${{ runner.os }}-bazel | |
- name: Install bazelisk | |
run: | | |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/latest/download/$BAZEL" | |
chmod +x $BAZEL | |
- name: Build | |
run: ./$BAZEL build -c opt //mozolm/... | |
- name: Test | |
run: ./$BAZEL test -c opt --test_output=errors //mozolm/... |