1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-14 16:26:55 +08:00

test.yml: Remove redundant code (#595)

This commit is contained in:
Christian Clauss
2021-09-13 08:31:32 +02:00
committed by GitHub
parent bb5cdfe050
commit 28c99c77be

View File

@@ -25,92 +25,41 @@ jobs:
- name: Lint with Black - name: Lint with Black
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then pip install --upgrade pip
python.exe -m pip install pip --upgrade pip install black wheel
python.exe -m pip install wheel --upgrade black qlib -l 120 --check --diff
python.exe -m pip install black
python.exe -m black qlib -l 120 --check --diff
else
python -m pip install pip --upgrade
python -m pip install wheel --upgrade
python -m pip install black
python -m black qlib -l 120 --check --diff
fi
shell: bash
- name: Install Qlib with pip - name: Install Qlib with pip
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then pip install numpy==1.19.5 ruamel.yaml
python.exe -m pip install numpy==1.19.5 pip install pyqlib --ignore-installed
python.exe -m pip install pyqlib --ignore-installed ruamel.yaml numpy --user
else
python -m pip install numpy==1.19.5
python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
fi
shell: bash
- name: Test data downloads - name: Test data downloads
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
python.exe scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
else
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
fi
shell: bash
- name: Test workflow by config (install from pip) - name: Test workflow by config (install from pip)
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml python -m pip uninstall -y pyqlib
python.exe -m pip uninstall -y pyqlib
else
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
python -m pip uninstall -y pyqlib
fi
shell: bash
# Test Qlib installed from source # Test Qlib installed from source
- name: Install Qlib from source - name: Install Qlib from source
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then pip install --upgrade cython jupyter jupyter_contrib_nbextensions numpy scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
python.exe -m pip install --upgrade cython pip install -e .
python.exe -m pip install numpy jupyter jupyter_contrib_nbextensions
python.exe -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
python.exe setup.py install
else
python -m pip install --upgrade cython
python -m pip install numpy jupyter jupyter_contrib_nbextensions
python -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
python setup.py install
fi
shell: bash
- name: Install test dependencies - name: Install test dependencies
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then pip install --upgrade pip
python.exe -m pip install --upgrade pip pip install black pytest
python.exe -m pip install black pytest
else
python -m pip install --upgrade pip
python -m pip install black pytest
fi
shell: bash
- name: Unit tests with Pytest - name: Unit tests with Pytest
run: | run: |
cd tests cd tests
if [ "$RUNNER_OS" == "Windows" ]; then python -m pytest . --durations=10
python.exe -m pytest . --durations=0
else
python -m pytest . --durations=0
fi
shell: bash
- name: Test workflow by config (install from source) - name: Test workflow by config (install from source)
run: | run: |
if [ "$RUNNER_OS" == "Windows" ]; then python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
else
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
fi
shell: bash