Build and Test (macOS 15) #429
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 (macOS 15) | |
permissions: read-all | |
on: | |
schedule: | |
# daily at 3 AM | |
- cron: "0 3 * * *" | |
pull_request: | |
types: [labeled] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-and-test: | |
if: github.event_name != 'pull_request' || github.event.label.name == 'ci:macos' | |
runs-on: | |
labels: macos-15 | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # pin@v3 | |
- name: Cache bazel build artifacts | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # [email protected] | |
with: | |
path: | | |
~/.cache/bazel | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}-${{ hashFiles('bazel/import_llvm.bzl') }} | |
restore-keys: | | |
${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}- | |
- name: Install coreutils | |
run: brew install coreutils | |
- name: Install rust | |
run: brew install rust | |
- name: Install OpenMP | |
run: brew install libomp | |
- name: Set OpenMP environment variables | |
run: | | |
echo "LDFLAGS=-L$(brew --prefix libomp)/lib" >> "$GITHUB_ENV" | |
echo "CPPFLAGS=-I$(brew --prefix libomp)/include" >> "$GITHUB_ENV" | |
- name: "Run `bazel build`" | |
run: | | |
bazel build --noincompatible_strict_action_env --action_env=PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" -c opt //... | |
- name: "Run `bazel test`" | |
run: | | |
bazel test --noincompatible_strict_action_env --action_env=PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" -c opt //... |