Skip to content

PDLL article

PDLL article #151

name: Build and Test w/Bazel
permissions: read-all
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3
- name: Cache bazel build artifacts
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # [email protected]
with:
path: |
~/.cache/bazel
# add import_llvm.bzl so that a new build occurs after an LLVM commit hash update
key: ${{ runner.os }}-bazel-${{ hashFiles('bazel/import_llvm.bzl') }}-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE') }}
restore-keys: |
${{ runner.os }}-bazel-${{ hashFiles('bazel/import_llvm.bzl') }}
- name: "Run `bazel build`"
run: |
bazel build -c fastbuild //...
- name: "Run `bazel test`"
run: |
bazel test -c fastbuild //...