Skip to content

Build options matrix (linux) #56

Build options matrix (linux)

Build options matrix (linux) #56

name: Build options matrix (linux)
permissions: read-all
on:
schedule:
- cron: '0 0 * * 0' # Run at midnight (UTC) every Sunday
workflow_dispatch: # Allow manual triggering
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-multi-option:
strategy:
matrix:
compilation_mode:
- "opt"
- "fastbuild"
- "dbg"
enable_openmp:
- 0
- 1
enable_yosys:
- 0
- 1
fail-fast: false
runs-on:
labels: ubuntu-latest
env:
BUILDBUDDY_API_KEY: ${{ github.repository == 'google/heir' && secrets.BUILDBUDDY_API_KEY || 'SEVzwPt2S7PHhY1OxD3u' }}
BAZEL_CONFIG_FLAG: ${{ github.repository == 'google/heir' && '--config=ci --config=remote' || '--config=ci' }}
steps:
- name: Check out repository code
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: "Run `bazel build`"
run: |
read -r -a BAZEL_CONFIGS <<< "$BAZEL_CONFIG_FLAG"
bazel build --incompatible_strict_action_env -c ${{ matrix.compilation_mode }} \
--//:enable_openmp=${{ matrix.enable_openmp }} \
--//:enable_yosys=${{ matrix.enable_yosys }} \
"${BAZEL_CONFIGS[@]}" \
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
//...
- name: "Run `bazel test`"
run: |
read -r -a BAZEL_CONFIGS <<< "$BAZEL_CONFIG_FLAG"
bazel test --incompatible_strict_action_env -c ${{ matrix.compilation_mode }} \
--//:enable_openmp=${{ matrix.enable_openmp }} \
--//:enable_yosys=${{ matrix.enable_yosys }} \
"${BAZEL_CONFIGS[@]}" \
--remote_header=x-buildbuddy-api-key="$BUILDBUDDY_API_KEY" \
//...