-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] [python-package] Add CI job testing compatibility with oldest po…
…ssible versions (#5936)
- Loading branch information
Showing
2 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
|
||
# oldest versions of dependencies published after | ||
# minimum supported Python version's first release | ||
# | ||
# see https://devguide.python.org/versions/ | ||
# | ||
echo "installing lightgbm's dependencies" | ||
pip install \ | ||
'numpy==1.12.0' \ | ||
'pandas==0.24.0' \ | ||
'scikit-learn==0.18.2' \ | ||
'scipy==0.19.0' \ | ||
|| exit -1 | ||
echo "done installing lightgbm's dependencies" | ||
|
||
echo "installing lightgbm" | ||
pip install --no-deps dist/*.whl || exit -1 | ||
echo "done installing lightgbm" | ||
|
||
echo "installed package versions:" | ||
pip freeze | ||
|
||
echo "" | ||
echo "checking that examples run without error" | ||
|
||
# run a few examples to test that Python package minimally works | ||
echo "" | ||
echo "--- advanced_example.py ---" | ||
echo "" | ||
python ./examples/python-guide/advanced_example.py || exit -1 | ||
|
||
echo "" | ||
echo "--- logistic_regression.py ---" | ||
echo "" | ||
python ./examples/python-guide/logistic_regression.py || exit -1 | ||
|
||
echo "" | ||
echo "--- simple_example.py ---" | ||
echo "" | ||
python ./examples/python-guide/simple_example.py || exit -1 | ||
|
||
echo "" | ||
echo "--- sklearn_example.py ---" | ||
echo "" | ||
python ./examples/python-guide/sklearn_example.py || exit -1 | ||
|
||
echo "" | ||
echo "done testing on oldest supported Python version" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,10 +76,36 @@ jobs: | |
export PATH=${CONDA}/bin:${PATH} | ||
$GITHUB_WORKSPACE/.ci/setup.sh || exit -1 | ||
$GITHUB_WORKSPACE/.ci/test.sh || exit -1 | ||
test-oldest-versions: | ||
name: Python - oldest supported versions (ubuntu-latest) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 5 | ||
submodules: true | ||
- name: Create wheel | ||
run: | | ||
docker run \ | ||
--rm \ | ||
-v $(pwd):/opt/lgb-build \ | ||
-w /opt/lgb-build \ | ||
lightgbm/vsts-agent:manylinux_2_28_x86_64 \ | ||
/bin/bash -c 'PATH=/opt/miniforge/bin:$PATH sh ./build-python.sh bdist_wheel --nomp' | ||
- name: Test compatibility | ||
run: | | ||
docker run \ | ||
--rm \ | ||
-v $(pwd):/opt/lgb-build \ | ||
-w /opt/lgb-build \ | ||
python:3.6 \ | ||
/bin/bash ./.ci/test-python-oldest.sh | ||
all-python-package-jobs-successful: | ||
if: always() | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
needs: [test, test-oldest-versions] | ||
steps: | ||
- name: Note that all tests succeeded | ||
uses: re-actors/[email protected] | ||
|