Load the builtin Bazel java rules from @rules_java #908
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: "windows" | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-and-test-windows: | |
name: Build and Test (Windows) | |
runs-on: windows-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.9.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- name: Update environment variables | |
# See: | |
# - On Bazel cache: https://docs.bazel.build/versions/master/output_directories.html | |
# - On problems with `tar.exe`: https://github.com/actions/toolkit/issues/632 | |
# - For symlinking: https://www.joshkel.com/2018/01/18/symlinks-in-windows/ | |
run: | | |
echo "BAZEL_CACHE_DIR=$env:USERPROFILE\_bazel_$env:USERNAME" >> $env:GITHUB_ENV | |
echo "BAZEL_SH=C:\msys64\usr\bin\bash.exe" >> $env:GITHUB_ENV | |
echo "PATH=C:\msys64\usr\bin:$env:PATH" >> $env:GITHUB_ENV | |
echo "MSYS=winsymlinks:nativestrict" >> $env:GITHUB_ENV | |
echo "MSYS_NO_PATHCONV=1" >> $env:GITHUB_ENV | |
echo "MSYS2_ARG_CONV_EXCL='*'" >> $env:GITHUB_ENV | |
- name: Inspect Environment Variables | |
run: env | |
# TODO: Disabling the cache for now. Generated cache has broken | |
# symlinks, which breaks the build. | |
# | |
#- name: Mount bazel cache | |
# uses: actions/cache@v3 | |
# with: | |
# path: ${{ env.BAZEL_CACHE_DIR}} | |
# key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE.bazel') }} | |
# restore-keys: ${{ runner.os }}-bazel | |
- name: Install bazelisk | |
run: | | |
powershell Invoke-WebRequest https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-windows-amd64.exe -OutFile bazel.exe | |
- name: Build | |
run: ./bazel.exe build -c opt //mozolm/... | |
- name: Test | |
run: ./bazel.exe test -c opt //mozolm/... |