Skip to content

examples: update MODULE.bazel #20

examples: update MODULE.bazel

examples: update MODULE.bazel #20

# ref: https://github.com/actions/runner-images
name: amd64 MacOS Bazel
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
# Building using the github runner environement directly.
jobs:
native:
strategy:
matrix:
examples: [
{name: basic},
# {name: embed}, # see: https://github.com/pybind/pybind11_bazel/issues/76
]
cpp: [
#{version: 14, flags: "-std=c++14"},
{version: 17, flags: "-std=c++17"},
{version: 20, flags: "-std=c++20"},
]
python: [
{version: '3.11'},
{version: '3.12'},
]
fail-fast: false
name: MacOS•Bzl•C++${{matrix.cpp.version}}•Py${{matrix.python.version}}•${{matrix.examples.name}}
runs-on: macos-13 # last macos intel based runner
steps:
- uses: actions/checkout@v5
- name: Set Java to OpenJDK 17 (Temurin)
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: ${{matrix.python.version}}
- name: Check Python
run: |
python --version
python -m platform
- name: Check Bazel
run: bazel version
- name: Build
run: >
cd examples/${{matrix.examples.name}} &&
bazel build
--config=ci
--@rules_python//python/config_settings:python_version=${{matrix.python.version}}
--cxxopt=${{matrix.cpp.flags}} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
//...
- name: Test
run: >
cd examples/${{matrix.examples.name}} &&
bazel test
--config=ci
--@rules_python//python/config_settings:python_version=${{matrix.python.version}}
--cxxopt=${{matrix.cpp.flags}} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
//...
amd64_macos_bazel:
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v5