-
Notifications
You must be signed in to change notification settings - Fork 4k
WIP: [ci] move Windows Python jobs to GitHub Actions #7086
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
base: master
Are you sure you want to change the base?
Conversation
| artifacts/*.dll | ||
| artifacts/*.dylib | ||
| artifacts/*.exe | ||
| artifacts/*.whl |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
LightGBM/.github/workflows/r_package.yml
Line 178 in 3f7db2b
| - name: Setup and run tests on Linux and macOS |
.github/workflows/python_package.yml
Outdated
| 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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 }}" |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Moving this back to draft while I work on that.
| # 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" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Pushed f34e8b9 proposing that we treat "set to 0" and "unset" as both meaning "skip the test".
Contributes to #6949
Moves Windows Python-package CI jobs to GitHub Actions.