Unverified Commit 7cb18923 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] [python-package] run macOS x86_64 tests on macOS 12 (Monterey), stop...

[ci] [python-package] run macOS x86_64 tests on macOS 12 (Monterey), stop manually setting macOS wheel tags (#6487)
parent d56a7a3c
...@@ -14,7 +14,7 @@ if [[ $OS_NAME == "macos" ]]; then ...@@ -14,7 +14,7 @@ if [[ $OS_NAME == "macos" ]]; then
if [[ $COMPILER == "clang" ]]; then if [[ $COMPILER == "clang" ]]; then
brew install libomp brew install libomp
if [[ $AZURE == "true" ]]; then if [[ $AZURE == "true" ]]; then
sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer || exit 1 sudo xcode-select -s /Applications/Xcode_13.1.0.app/Contents/Developer || exit 1
fi fi
else # gcc else # gcc
# Check https://github.com/actions/runner-images/tree/main/images/macos for available # Check https://github.com/actions/runner-images/tree/main/images/macos for available
......
...@@ -29,6 +29,19 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then ...@@ -29,6 +29,19 @@ if [[ $IN_UBUNTU_BASE_CONTAINER == "true" ]]; then
export LC_ALL="en_US.UTF-8" export LC_ALL="en_US.UTF-8"
fi fi
# Setting MACOSX_DEPLOYMENT_TARGET prevents CMake from building against too-new
# macOS features, and helps tools like Python build tools determine the appropriate
# wheel compatibility tags.
#
# ref:
# * https://cmake.org/cmake/help/latest/envvar/MACOSX_DEPLOYMENT_TARGET.html
# * https://github.com/scikit-build/scikit-build-core/blob/acb7d0346e4a05bcb47a4ea3939c705ab71e3145/src/scikit_build_core/builder/macos.py#L36
if [[ $ARCH == "x86_64" ]]; then
export MACOSX_DEPLOYMENT_TARGET=10.15
else
export MACOSX_DEPLOYMENT_TARGET=12.0
fi
if [[ "${TASK}" == "r-package" ]] || [[ "${TASK}" == "r-rchk" ]]; then if [[ "${TASK}" == "r-package" ]] || [[ "${TASK}" == "r-rchk" ]]; then
bash ${BUILD_DIRECTORY}/.ci/test_r_package.sh || exit 1 bash ${BUILD_DIRECTORY}/.ci/test_r_package.sh || exit 1
exit 0 exit 0
...@@ -168,17 +181,6 @@ elif [[ $TASK == "bdist" ]]; then ...@@ -168,17 +181,6 @@ elif [[ $TASK == "bdist" ]]; then
if [[ $OS_NAME == "macos" ]]; then if [[ $OS_NAME == "macos" ]]; then
cd $BUILD_DIRECTORY && sh ./build-python.sh bdist_wheel || exit 1 cd $BUILD_DIRECTORY && sh ./build-python.sh bdist_wheel || exit 1
sh $BUILD_DIRECTORY/.ci/check_python_dists.sh $BUILD_DIRECTORY/dist || exit 1 sh $BUILD_DIRECTORY/.ci/check_python_dists.sh $BUILD_DIRECTORY/dist || exit 1
mv \
./dist/*.whl \
./dist/tmp.whl || exit 1
if [[ $ARCH == "x86_64" ]]; then
PLATFORM="macosx_10_15_x86_64.macosx_11_6_x86_64.macosx_12_5_x86_64"
else
PLATFORM="macosx_14_0_arm64"
fi
mv \
./dist/tmp.whl \
dist/lightgbm-$LGB_VER-py3-none-$PLATFORM.whl || exit 1
if [[ $PRODUCES_ARTIFACTS == "true" ]]; then if [[ $PRODUCES_ARTIFACTS == "true" ]]; then
cp dist/lightgbm-$LGB_VER-py3-none-macosx*.whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1 cp dist/lightgbm-$LGB_VER-py3-none-macosx*.whl $BUILD_ARTIFACTSTAGINGDIRECTORY || exit 1
fi fi
......
...@@ -254,7 +254,7 @@ jobs: ...@@ -254,7 +254,7 @@ jobs:
OS_NAME: 'macos' OS_NAME: 'macos'
PRODUCES_ARTIFACTS: 'true' PRODUCES_ARTIFACTS: 'true'
pool: pool:
vmImage: 'macOS-11' vmImage: 'macOS-12'
strategy: strategy:
matrix: matrix:
regular: regular:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment