Skip to content

Conversation

@jameslamb
Copy link
Collaborator

Contributes to #6949

Moves Windows Python-package CI jobs to GitHub Actions.

artifacts/*.dll
artifacts/*.dylib
artifacts/*.exe
artifacts/*.whl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*.whl shows up in the diff here only because I'm taking this opportunity to alphabetize this list.

persist-credentials: false
submodules: true
- name: Setup and run tests
- name: Setup and run tests on Linux and macOS
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be expanded with Linux jobs as well in the next PR.

This name matches the step name in the R-package workflow:

- name: Setup and run tests on Linux and macOS

@jameslamb jameslamb changed the title WIP: [ci] move Windows Python jobs to GitHub Actions [ci] move Windows Python jobs to GitHub Actions Nov 23, 2025
@jameslamb jameslamb marked this pull request as ready for review November 23, 2025 06:21
Comment on lines 190 to 194
cmd /c "conda config --remove channels defaults"
cmd /c "conda config --add channels nodefaults"
cmd /c "conda config --add channels conda-forge"
cmd /c "conda config --set channel_priority strict"
cmd /c "conda init powershell"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this twice: here and in test-windows.ps1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh! I think I meant to have this only in test-windows.ps1 but left it in from other stuff I copied from .vsts-ci.yml. Let me try removing that, thanks for catching it.

run: |
$env:PATH = "$env:CONDA/Scripts;$env:PATH"
$env:PRODUCES_ARTIFACTS = "${{ matrix.produces-artifacts }}"
$env:TASK = "${{ matrix.task }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we need more env variables here, e.g. METHOD, OS_NAME, PYTHON_VERSION, because right now wrong Python version is used:

============================= test session starts =============================
platform win32 -- Python 3.14.0, pytest-9.0.1, pluggy-1.6.0

https://github.com/microsoft/LightGBM/actions/runs/19627711345/job/56199935267?pr=7086#step:5:4848

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you're completely right. I was following patterns from other jobs like SWIG and the R-package, but I guess those don't need to set any of these things (they only affect Python tests).

Will push a fix.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My changes are not quite working:

[INFO] --- building sdist ---
C:\hostedtoolcache\windows\Python\3.9.13\x64\python.exe: No module named build
Error: Process completed with exit code -1.

(build link)

Moving this back to draft while I work on that.

@jameslamb jameslamb changed the title [ci] move Windows Python jobs to GitHub Actions WIP: [ci] move Windows Python jobs to GitHub Actions Nov 25, 2025
@jameslamb jameslamb marked this pull request as draft November 25, 2025 04:21
# Make sure we can do both CPU and GPU; see tests/python_package_test/test_dual.py
# TODO: set LIGHTGBM_TEST_DUAL_CPU_GPU back to "1" as part of https://github.com/microsoft/LightGBM/issues/6968
env:LIGHTGBM_TEST_DUAL_CPU_GPU = "0"
$env:LIGHTGBM_TEST_DUAL_CPU_GPU = "0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how this was working before on Azure DevOps, but it's failing here.

env:LIGHTGBM_TEST_DUAL_CPU_GPU: D:\a\LightGBM\LightGBM.ci\test-windows.ps1:150
Line |
150 | env:LIGHTGBM_TEST_DUAL_CPU_GPU = "0"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The term 'env:LIGHTGBM_TEST_DUAL_CPU_GPU' is not recognized as a name of a cmdlet, function, script file, or
| executable program. Check the spelling of the name, or if a path was included, verify that the path is correct
| and try again.
Error: Process completed with exit code 1.

(build link)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change exposed something else... test_dual.py is skipped only if LIGHTGBM_TEST_DUAL_CPU_GPU is unset but runs if it's set to any value.

FAILED ..\tests\python_package_test\test_dual.py::test_cpu_and_gpu_work - lightgbm.basic.LightGBMError: GPU Tree Learner was not enabled in this build.
Please recompile with CMake option -DUSE_GPU=1

(build link)

Pushed f34e8b9 proposing that we treat "set to 0" and "unset" as both meaning "skip the test".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants