workflows: install llvm tools from apt.llvm.org #8026
Workflow file for this run
This file contains hidden or 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: Build and Test (Linux) | |
permissions: read-all | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test: | |
runs-on: | |
labels: ubuntu-24.04-64core | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3 | |
- name: Install dependencies | |
run: | | |
./.github/install_clang_version.sh 19 | |
- name: Cache bazel build artifacts | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # [email protected] | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}-${{ hashFiles('bazel/import_llvm.bzl') }} | |
restore-keys: | | |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}-${{ hashFiles('bazel/import_llvm.bzl') }} | |
${{ runner.os }}-clang19-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}- | |
- name: Confirm bazel is using the right C compiler | |
run: | | |
# Pure debugging bazel stuff: ensure the compiler installed is the | |
# one used by bazel. Note that the path to the C compiler is part of | |
# the cache, so if the compiler changes but the cache does not, it | |
# will try to use the old compiler path. | |
which -a clang | xargs ls -al | |
ls -al /etc/alternatives/clang | |
bazel cquery --output=starlark --starlark:expr="str(providers(target))" @bazel_tools//tools/cpp:current_cc_toolchain | sed 's/,/\n/g' | grep -C 5 clang | |
- name: "Run `bazel build`" | |
run: | | |
bazel build -c opt //... | |
- name: "Run `bazel test`" | |
run: | | |
bazel test -c opt //... |