Skip to content

Commit 92a8741

Browse files
authored
[ci] Skip Arrow tests on AppVeyor, use Intel macOS runners, upgrade to XCode 14.3 on macOS jobs, disable MacOS MPI jobs (#6425)
1 parent 1443548 commit 92a8741

File tree

5 files changed

+38
-24
lines changed

5 files changed

+38
-24
lines changed

.ci/setup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ if [[ $OS_NAME == "macos" ]]; then
1717
sudo xcode-select -s /Applications/Xcode_11.7.app/Contents/Developer || exit 1
1818
fi
1919
else # gcc
20-
sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer || exit 1
20+
# Check https://github.com/actions/runner-images/tree/main/images/macos for available
21+
# versions of Xcode
22+
sudo xcode-select -s /Applications/Xcode_14.3.1.app/Contents/Developer || exit 1
2123
if [[ $TASK != "mpi" ]]; then
2224
brew install gcc
2325
fi

.ci/test_windows.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function Check-Output {
99
# unify environment variable for Azure DevOps and AppVeyor
1010
if (Test-Path env:APPVEYOR) {
1111
$env:APPVEYOR = "true"
12+
$env:ALLOW_SKIP_ARROW_TESTS = "1"
1213
}
1314

1415
if ($env:TASK -eq "r-package") {

.github/workflows/python_package.yml

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,32 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
include:
30-
- os: macOS-latest
30+
- os: macos-13
3131
task: regular
3232
python_version: '3.9'
33-
- os: macOS-latest
33+
- os: macos-13
3434
task: sdist
3535
python_version: '3.10'
36-
- os: macOS-latest
36+
- os: macos-13
3737
task: bdist
3838
python_version: '3.7'
39-
- os: macOS-latest
39+
- os: macos-13
4040
task: if-else
4141
python_version: '3.9'
42-
- os: macOS-latest
43-
task: mpi
44-
method: source
45-
python_version: '3.10'
46-
- os: macOS-latest
47-
task: mpi
48-
method: pip
49-
python_version: '3.11'
50-
- os: macOS-latest
51-
task: mpi
52-
method: wheel
53-
python_version: '3.8'
42+
# We're currently skipping MPI jobs on macOS, see https://github.com/microsoft/LightGBM/pull/6425
43+
# for further details.
44+
# - os: macos-13
45+
# task: mpi
46+
# method: source
47+
# python_version: '3.10'
48+
# - os: macos-13
49+
# task: mpi
50+
# method: pip
51+
# python_version: '3.11'
52+
# - os: macos-13
53+
# task: mpi
54+
# method: wheel
55+
# python_version: '3.8'
5456
steps:
5557
- name: Checkout repository
5658
uses: actions/checkout@v3
@@ -63,7 +65,7 @@ jobs:
6365
export TASK="${{ matrix.task }}"
6466
export METHOD="${{ matrix.method }}"
6567
export PYTHON_VERSION="${{ matrix.python_version }}"
66-
if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then
68+
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
6769
export COMPILER="gcc"
6870
export OS_NAME="macos"
6971
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then

.github/workflows/r_package.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ jobs:
6363
r_version: 4.3
6464
build_type: cmake
6565
container: 'ubuntu:22.04'
66-
- os: macOS-latest
66+
- os: macos-13
6767
task: r-package
6868
compiler: gcc
6969
r_version: 4.3
7070
build_type: cmake
7171
container: null
72-
- os: macOS-latest
72+
- os: macos-13
7373
task: r-package
7474
compiler: clang
7575
r_version: 4.3
@@ -128,7 +128,7 @@ jobs:
128128
r_version: 4.3
129129
build_type: cran
130130
container: 'ubuntu:22.04'
131-
- os: macOS-latest
131+
- os: macos-13
132132
task: r-package
133133
compiler: clang
134134
r_version: 4.3
@@ -184,13 +184,13 @@ jobs:
184184
CTAN_MIRROR: https://ctan.math.illinois.edu/systems/win32/miktex
185185
TINYTEX_INSTALLER: TinyTeX
186186
- name: Setup and run tests on Linux and macOS
187-
if: matrix.os == 'macOS-latest' || matrix.os == 'ubuntu-latest'
187+
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-latest'
188188
shell: bash
189189
run: |
190190
export TASK="${{ matrix.task }}"
191191
export COMPILER="${{ matrix.compiler }}"
192192
export GITHUB_ACTIONS="true"
193-
if [[ "${{ matrix.os }}" == "macOS-latest" ]]; then
193+
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
194194
export OS_NAME="macos"
195195
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
196196
export OS_NAME="linux"

tests/python_package_test/test_arrow.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
# coding: utf-8
22
import filecmp
3+
import os
34
from pathlib import Path
45
from typing import Any, Dict, Optional
56

67
import numpy as np
7-
import pyarrow as pa
88
import pytest
99

1010
import lightgbm as lgb
1111

1212
from .utils import np_assert_array_equal
1313

14+
# NOTE: In the AppVeyor CI, importing pyarrow fails due to an old Visual Studio version. Hence,
15+
# we conditionally import pyarrow here (and skip tests if it cannot be imported). However, we
16+
# don't want these tests to silently be skipped, hence, we only conditionally import when a
17+
# specific env var is set.
18+
if os.getenv("ALLOW_SKIP_ARROW_TESTS") == "1":
19+
pa = pytest.importorskip("pyarrow")
20+
else:
21+
import pyarrow as pa # type: ignore
22+
1423
# ----------------------------------------------------------------------------------------------- #
1524
# UTILITIES #
1625
# ----------------------------------------------------------------------------------------------- #

0 commit comments

Comments
 (0)