Skip to content

Update Bazel support #4

Update Bazel support

Update Bazel support #4

# ref: https://github.com/actions/runner-images
name: amd64 MacOS Bazel
on: [push, pull_request, workflow_dispatch]
# Building using the github runner environement directly.
jobs:
native:
strategy:
matrix:
bazel: [
{compilation_mode: opt},
{compilation_mode: dbg},
]
cpp: [
#{version: 14, flags: "-std=c++14"},
{version: 17, flags: "-std=c++17"},
#{version: 20, flags: "-std=c++20"},
]
python: [
#{version: '3.8'},
#{version: '3.9'},
#{version: '3.10'},
{version: '3.11'},
{version: '3.12'},
]
exclude:
# only test `-c dbg` build with C++17 and Python{3.11,3.12}
- cpp: {version: 14}
bazel: {compilation_mode: dbg}
- cpp: {version: 20}
bazel: {compilation_mode: dbg}
- python: {version: '3.8'}
bazel: {compilation_mode: dbg}
- python: {version: '3.9'}
bazel: {compilation_mode: dbg}
- python: {version: '3.10'}
bazel: {compilation_mode: dbg}
fail-fast: false
name: MacOS•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
runs-on: macos-13 # last macos intel based runner
steps:
- uses: actions/checkout@v4
- name: Set Java to OpenJDK 17 (Temurin)
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
- name: Check Python
run: |
python --version
python -m platform
- name: Check Bazel
run: bazel version
- name: Change Python in MODULE.bazel
run: |
sed -i '' -e 's/\(DEFAULT_PYTHON =\) "3.[0-9]*"/\1 "${{ matrix.python.version }}"/g' MODULE.bazel
cat MODULE.bazel
- name: Build
run: >
bazel build
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...
- name: Test
run: >
bazel test
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...