Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Enable logging rc options.
common --announce_rc

###############################################################################
# Put user-specific options in user.bazelrc
# See https://bazel.build/configure/best-practices#bazelrc-file
################################################################################
try-import %workspace%/user.bazelrc
74 changes: 74 additions & 0 deletions .github/workflows/amd64_linux_bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# ref: https://github.com/actions/runner-images
name: amd64 Linux 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.11'},
]
exclude:
# only test `-c dbg` build with C++17
- cpp: {version: 14}
bazel: {compilation_mode: dbg}
- cpp: {version: 20}
bazel: {compilation_mode: dbg}
fail-fast: false
name: Linux•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Java
run: java -version
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
- name: Check Python
run: |
python --version
python -m platform
- uses: bazel-contrib/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Check Bazel
run: bazel version
- name: Build
run: >
cd examples/basic &&
bazel build
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...
- name: Test
run: >
cd examples/basic &&
bazel test
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...

amd64_linux_bazel:
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v4
72 changes: 72 additions & 0 deletions .github/workflows/amd64_macos_bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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.11'},
]
exclude:
# only test `-c dbg` build with C++17
- cpp: {version: 14}
bazel: {compilation_mode: dbg}
- cpp: {version: 20}
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: Build
run: >
cd examples/basic &&
bazel build
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...
- name: Test
run: >
cd examples/basic &&
bazel test
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...

amd64_macos_bazel:
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v4
77 changes: 77 additions & 0 deletions .github/workflows/amd64_windows_bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# ref: https://github.com/actions/runner-images
name: amd64 Windows Bazel

on: [push, pull_request, workflow_dispatch]

# Building using the github runner environement directly.
jobs:
native:
strategy:
matrix:
runner: [
windows-2022,
#windows-2019,
]
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.11'},
]
exclude:
- runner: windows-2019
cpp: {version: 20}
# only test -c dbg with VS 2022 version 17 to save compute time
- runner: windows-2019
bazel: {compilation_mode: dbg}
- cpp: {version: 14}
bazel: {compilation_mode: dbg}
- cpp: {version: 20}
bazel: {compilation_mode: dbg}
fail-fast: false # Don't cancel all jobs if one fails.
name: ${{ matrix.runner }}•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
- name: Check Python
run: |
python --version
python -m platform
- name: Install Bazel
run: choco install bazel
- name: Check Bazel
run: bazel version
- name: Build
run: >
cd examples/basic &&
bazel build
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...
- name: Test
run: >
cd examples/basic &&
bazel test
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...

amd64_windows_bazel:
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v4
72 changes: 72 additions & 0 deletions .github/workflows/arm64_macos_bazel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# ref: https://github.com/actions/runner-images
name: arm64 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.11'},
]
exclude:
# only test `-c dbg` build with C++17
- cpp: {version: 14}
bazel: {compilation_mode: dbg}
- cpp: {version: 20}
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-latest
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: Build
run: >
cd examples/basic &&
bazel build
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...
- name: Test
run: >
cd examples/basic &&
bazel test
-c ${{ matrix.bazel.compilation_mode }}
--cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }}
--subcommands=pretty_print
--enable_bzlmod
//...

arm64_macos_bazel:
runs-on: ubuntu-latest
needs: native
steps:
- uses: actions/checkout@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
bazel-*
MODULE.bazel.lock

user.bazelrc
.*.swp
1 change: 1 addition & 0 deletions examples/basic/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_python", version = "0.34.0")
bazel_dep(name = "pybind11_bazel")
local_path_override(
Expand Down
Loading