Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macos_brew_install_llvm to ci.yml #4326

Merged
merged 3 commits into from
Nov 12, 2022
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
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1037,3 +1037,70 @@ jobs:

- name: Clean directory
run: git clean -fdx

macos_brew_install_llvm:
name: "macos-latest • brew install llvm"
runs-on: macos-latest

env:
# https://apple.stackexchange.com/questions/227026/how-to-install-recent-clang-with-homebrew
LDFLAGS: '-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib'

steps:
- name: Update PATH
run: echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH

- name: Show env
run: env

- name: Checkout
uses: actions/checkout@v3

- name: Show Clang++ version before brew install llvm
run: clang++ --version

- name: brew install llvm
run: brew install llvm

- name: Show Clang++ version after brew install llvm
run: clang++ --version

- name: Update CMake
uses: jwlawson/actions-setup-cmake@v1.13

- name: Run pip installs
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r tests/requirements.txt
python3 -m pip install numpy
python3 -m pip install scipy

- name: Show CMake version
run: cmake --version

- name: CMake Configure
run: >
cmake -S . -B .
-DCMAKE_VERBOSE_MAKEFILE=ON
-DPYBIND11_WERROR=ON
-DPYBIND11_SIMPLE_GIL_MANAGEMENT=OFF
-DDOWNLOAD_CATCH=ON
-DDOWNLOAD_EIGEN=ON
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_CXX_STANDARD=17
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)")

- name: Build
run: cmake --build . -j 2

- name: Python tests
run: cmake --build . --target pytest -j 2

- name: C++ tests
run: cmake --build . --target cpptest -j 2

- name: Interface test
run: cmake --build . --target test_cmake_build -j 2

- name: Clean directory
run: git clean -fdx
5 changes: 3 additions & 2 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import env
import pybind11_cross_module_tests as cm
import pybind11_tests # noqa: F401
from pybind11_tests import exceptions as m


Expand Down Expand Up @@ -72,9 +73,9 @@ def test_cross_module_exceptions(msg):

# TODO: FIXME
@pytest.mark.xfail(
"env.PYPY and env.MACOS",
"env.MACOS and (env.PYPY or pybind11_tests.compiler_info.startswith('Homebrew Clang'))",
raises=RuntimeError,
reason="Expected failure with PyPy and libc++ (Issue #2847 & PR #2999)",
reason="See Issue #2847, PR #2999, PR #4324",
)
def test_cross_module_exception_translator():
with pytest.raises(KeyError):
Expand Down