Unverified Commit 6453a041 authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

Merge branch 'master' into rocm3

parents 552fafc7 a8baffa6
...@@ -24,7 +24,6 @@ install: ...@@ -24,7 +24,6 @@ install:
- set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH% - set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
- set PYTHON_VERSION=%CONFIGURATION% - set PYTHON_VERSION=%CONFIGURATION%
- ps: | - ps: |
$env:ALLOW_SKIP_ARROW_TESTS = "1"
$env:APPVEYOR = "true" $env:APPVEYOR = "true"
$env:CMAKE_BUILD_PARALLEL_LEVEL = 4 $env:CMAKE_BUILD_PARALLEL_LEVEL = 4
$env:MINICONDA = "C:\Miniconda3-x64" $env:MINICONDA = "C:\Miniconda3-x64"
......
...@@ -153,7 +153,7 @@ if [[ "${TASK}" != "cpp-tests" ]] && [[ "${TASK}" != "r-package" ]]; then ...@@ -153,7 +153,7 @@ if [[ "${TASK}" != "cpp-tests" ]] && [[ "${TASK}" != "r-package" ]]; then
sh miniforge.sh -b -p "${CONDA}" sh miniforge.sh -b -p "${CONDA}"
fi fi
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda conda-libmamba-solver conda update -q -y conda
# print output of 'conda info', to help in submitting bug reports # print output of 'conda info', to help in submitting bug reports
echo "conda info:" echo "conda info:"
......
...@@ -66,7 +66,7 @@ if ($env:TASK -eq "swig") { ...@@ -66,7 +66,7 @@ if ($env:TASK -eq "swig") {
conda init powershell conda init powershell
conda activate conda activate
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda conda-libmamba-solver "python=$env:PYTHON_VERSION[build=*_cp*]" conda update -q -y conda "python=$env:PYTHON_VERSION[build=*_cp*]"
# print output of 'conda info', to help in submitting bug reports # print output of 'conda info', to help in submitting bug reports
Write-Output "conda info:" Write-Output "conda info:"
......
name: C++
on:
push:
branches:
- master
pull_request:
branches:
- master
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# tell scripts where to put artifacts
# (this variable name is left over from when jobs ran on Azure DevOps)
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
# where repo sources are cloned to
BUILD_DIRECTORY: '${{ github.workspace }}'
# in CMake-driven builds, parallelize compilation
CMAKE_BUILD_PARALLEL_LEVEL: 4
jobs:
test:
name: ${{ matrix.task }} (${{ matrix.os-display-name || matrix.os }}, ${{ matrix.compiler }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
#############
# C++ tests #
#############
- os: ubuntu-latest
task: cpp-tests
compiler: clang-17
method: with-sanitizers
container: 'ubuntu:22.04'
os-display-name: 'ubuntu22.04'
- os: macos-13
task: cpp-tests
compiler: clang
method: with-sanitizers
sanitizers: "address;undefined"
container: null
- os: windows-2022
task: cpp-tests
compiler: msvc
container: null
###########
# if-else #
###########
# These test CLI-generated C++ inference code.
#
# They need Python because they're written with pytest, but they
# do not need the LightGBM Python package
- os: ubuntu-latest
task: if-else
compiler: clang-17
container: 'ubuntu:22.04'
os-display-name: 'ubuntu22.04'
python_version: '3.13'
setup-conda: 'true'
- os: macos-13
task: if-else
compiler: clang
python_version: '3.10'
container: null
- os: ubuntu-latest
task: if-else
compiler: gcc
python_version: '3.11'
container: 'lightgbm.azurecr.io/vsts-agent:manylinux_2_28_x86_64'
os-display-name: 'manylinux_2_28'
steps:
- name: Install packages used by third-party actions
if: matrix.container == 'ubuntu:22.04'
shell: bash
run: |
apt-get update -y
apt-get install --no-install-recommends -y \
dirmngr \
gpg \
gpg-agent \
software-properties-common \
sudo
# install newest version of git
# ref:
# - https://unix.stackexchange.com/a/170831/550004
# - https://git-scm.com/download/linux
add-apt-repository ppa:git-core/ppa -y
apt-get update -y
apt-get install --no-install-recommends -y \
git
- name: Trust git cloning LightGBM
if: startsWith(matrix.os, 'ubuntu')
run: |
git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 5
persist-credentials: false
submodules: true
- name: Setup and run tests on Linux and macOS
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
shell: bash
run: |
export COMPILER="${{ matrix.compiler }}"
export CONDA="${HOME}/miniforge"
export METHOD="${{ matrix.method }}"
export PATH=${CONDA}/bin:${PATH}
export PYTHON_VERSION="${{ matrix.python_version }}"
export SANITIZERS="${{ matrix.sanitizers }}"
export SETUP_CONDA="${{ matrix.setup-conda }}"
export TASK="${{ matrix.task }}"
if [[ "${{ matrix.os }}" =~ ^macos ]]; then
export OS_NAME="macos"
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export OS_NAME="linux"
fi
if [[ "${{ matrix.container }}" == "ubuntu:22.04" ]]; then
export DEBIAN_FRONTEND=noninteractive
export IN_UBUNTU_BASE_CONTAINER="true"
fi
$GITHUB_WORKSPACE/.ci/setup.sh
$GITHUB_WORKSPACE/.ci/test.sh
- name: Setup and run tests on Windows
if: startsWith(matrix.os, 'windows')
shell: pwsh -command ". {0}"
run: |
$env:BUILD_SOURCESDIRECTORY = $env:BUILD_DIRECTORY
$env:TASK = "${{ matrix.task }}"
& "$env:GITHUB_WORKSPACE/.ci/test-windows.ps1"
all-cpp-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Note that all tests succeeded
uses: re-actors/alls-green@v1.2.2
with:
jobs: ${{ toJSON(needs) }}
...@@ -86,9 +86,6 @@ jobs: ...@@ -86,9 +86,6 @@ jobs:
- os: macos-13 - os: macos-13
task: bdist task: bdist
python_version: '3.9' python_version: '3.9'
- os: macos-13
task: if-else
python_version: '3.10'
- os: macos-14 - os: macos-14
task: bdist task: bdist
method: wheel method: wheel
......
...@@ -63,10 +63,10 @@ repos: ...@@ -63,10 +63,10 @@ repos:
- sphinx_rtd_theme>=3.0.1 - sphinx_rtd_theme>=3.0.1
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version. # Ruff version.
rev: v0.12.5 rev: v0.14.0
hooks: hooks:
# Run the linter. # Run the linter.
- id: ruff - id: ruff-check
args: ["--config", "python-package/pyproject.toml"] args: ["--config", "python-package/pyproject.toml"]
types_or: [python, jupyter] types_or: [python, jupyter]
# Run the formatter. # Run the formatter.
......
...@@ -103,8 +103,6 @@ jobs: ...@@ -103,8 +103,6 @@ jobs:
bdist: bdist:
TASK: bdist TASK: bdist
PYTHON_VERSION: '3.10' PYTHON_VERSION: '3.10'
inference:
TASK: if-else
mpi_source: mpi_source:
TASK: mpi TASK: mpi
METHOD: source METHOD: source
...@@ -168,8 +166,6 @@ jobs: ...@@ -168,8 +166,6 @@ jobs:
bdist: bdist:
TASK: bdist TASK: bdist
PYTHON_VERSION: '3.11' PYTHON_VERSION: '3.11'
inference:
TASK: if-else
mpi_source: mpi_source:
TASK: mpi TASK: mpi
METHOD: source METHOD: source
...@@ -193,9 +189,6 @@ jobs: ...@@ -193,9 +189,6 @@ jobs:
TASK: gpu TASK: gpu
METHOD: wheel METHOD: wheel
PYTHON_VERSION: '3.10' PYTHON_VERSION: '3.10'
cpp_tests:
TASK: cpp-tests
METHOD: with-sanitizers
steps: steps:
- script: | - script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
...@@ -245,10 +238,6 @@ jobs: ...@@ -245,10 +238,6 @@ jobs:
TASK: bdist TASK: bdist
swig: swig:
TASK: swig TASK: swig
cpp_tests:
TASK: cpp-tests
METHOD: with-sanitizers
SANITIZERS: "address;undefined"
steps: steps:
- script: | - script: |
echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY" echo "##vso[task.setvariable variable=BUILD_DIRECTORY]$BUILD_SOURCESDIRECTORY"
...@@ -299,8 +288,6 @@ jobs: ...@@ -299,8 +288,6 @@ jobs:
TASK: bdist TASK: bdist
swig: swig:
TASK: swig TASK: swig
cpp_tests:
TASK: cpp-tests
steps: steps:
- powershell: | - powershell: |
Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
......
...@@ -14,7 +14,7 @@ curl \ ...@@ -14,7 +14,7 @@ curl \
/bin/bash "${HOME}/miniforge.sh" -b -p "${CONDA}" /bin/bash "${HOME}/miniforge.sh" -b -p "${CONDA}"
conda config --set always_yes yes --set changeps1 no conda config --set always_yes yes --set changeps1 no
conda update -q -y conda conda-libmamba-solver conda update -q -y conda
conda env create \ conda env create \
--name docs-env \ --name docs-env \
......
# coding: utf-8 # coding: utf-8
import filecmp import filecmp
import os
from pathlib import Path from pathlib import Path
from typing import Any, Dict, Optional from typing import Any, Dict, Optional
...@@ -11,18 +10,10 @@ import lightgbm as lgb ...@@ -11,18 +10,10 @@ import lightgbm as lgb
from .utils import np_assert_array_equal from .utils import np_assert_array_equal
# NOTE: In the AppVeyor CI, importing pyarrow fails due to an old Visual Studio version. Hence, if not lgb.compat.PYARROW_INSTALLED:
# we conditionally import pyarrow here (and skip tests if it cannot be imported). However, we pytest.skip("pyarrow is not installed", allow_module_level=True)
# don't want these tests to silently be skipped, hence, we only conditionally import when a
# specific env var is set. import pyarrow as pa
if os.getenv("ALLOW_SKIP_ARROW_TESTS") == "1":
pa = pytest.importorskip("pyarrow")
else:
import pyarrow as pa # type: ignore
assert lgb.compat.PYARROW_INSTALLED is True, (
"'pyarrow' and its dependencies must be installed to run the arrow tests"
)
# ----------------------------------------------------------------------------------------------- # # ----------------------------------------------------------------------------------------------- #
# UTILITIES # # UTILITIES #
......
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