diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1db77f739c6c..f13ebe946097 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,26 +59,19 @@ jobs: go get github.com/bazelbuild/bazelisk echo "$(go env GOPATH)/bin" >> $GITHUB_PATH - # Setup to the latest LLVM and Clang release. - # - # Ideally we would use the pre-installed versions in the image, but the - # debian packages for LLVM-15 currently don't work for fastbuild. - # - # For now, we rely on Homebrew to manage installing a correctly built - # toolchain. We also take some care to be as resilient as possible to - # issues fetching and installing the toolchain. - - name: Install Clang/LLVM using brew + # On macOS, use Homebrew to install a recent LLVM and Clang. + - name: Setup LLVM and Clang (macOS) + if: matrix.os == 'macos-latest' env: HOMEBREW_NO_INSTALL_CLEANUP: 1 HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 - # Use llvm@14 because llvm (15) has sanitizer issues. run: | echo '*** Updating brew' brew update echo '*** Installing LLVM deps' - brew install --force-bottle --only-dependencies llvm@14 + brew install --force-bottle --only-dependencies llvm echo '*** Installing LLVM itself' - brew install --force-bottle --force --verbose llvm@14 + brew install --force-bottle --force --verbose llvm echo '*** brew info llvm' brew info llvm echo '*** brew config' @@ -86,6 +79,16 @@ jobs: echo '*** Updating PATH' echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH + # On Ubuntu, use apt.llvm.org to install a recent LLVM and Clang. + - name: Setup LLVM and Clang (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 15 all + rm llvm.sh + echo "/usr/lib/llvm-15/bin" >> $GITHUB_PATH + # Print the various tool paths and versions to help in debugging. - name: Print tool debugging info run: | @@ -114,10 +117,14 @@ jobs: # Add our bazel configuration and print basic info to ease debugging. - name: Configure Bazel and print info + env: + # Add a cache version for changes that bazel won't otherwise detect, + # like llvm version changes. + CACHE_VERSION: 1 run: | cat >user.bazelrc <