mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-13 07:46:53 +08:00
Update CI
This commit is contained in:
65
.github/workflows/test.yml
vendored
65
.github/workflows/test.yml
vendored
@@ -12,8 +12,8 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, ubuntu-16.04, ubuntu-18.04, macos-latest]
|
os: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-latest]
|
||||||
python-version: [3.7, 3.8]
|
python-version: [3.6, 3.7, 3.8]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -22,13 +22,22 @@ jobs:
|
|||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade cython
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
pip install numpy jupyter jupyter_contrib_nbextensions
|
$CONDA\\python.exe -m pip install --upgrade cython
|
||||||
pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
|
$CONDA\\python.exe -m pip install --upgrade cython
|
||||||
python setup.py install
|
$CONDA\\python.exe -m pip install numpy jupyter jupyter_contrib_nbextensions
|
||||||
|
$CONDA\\python.exe -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
|
||||||
|
$CONDA\\python.exe setup.py install
|
||||||
|
else
|
||||||
|
sudo $CONDA/bin/python -m pip install --upgrade cython
|
||||||
|
sudo $CONDA/bin/python -m pip install numpy jupyter jupyter_contrib_nbextensions
|
||||||
|
sudo $CONDA/bin/python -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
|
||||||
|
sudo $CONDA/bin/python setup.py install
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Install Lightgbm for MacOS
|
- name: Install Lightgbm for MacOS
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
@@ -38,23 +47,49 @@ jobs:
|
|||||||
|
|
||||||
- name: Install test dependencies
|
- name: Install test dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
pip install black pytest
|
$CONDA\\python.exe -m pip install --upgrade pip
|
||||||
|
$CONDA\\python.exe -m pip install black pytest
|
||||||
|
else
|
||||||
|
sudo $CONDA/bin/python -m pip install --upgrade pip
|
||||||
|
sudo $CONDA/bin/python -m pip install black pytest
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Lint with Black
|
- name: Lint with Black
|
||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
python -m black qlib -l 120 --check --diff
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
$CONDA\\python.exe -m black qlib -l 120 --check --diff
|
||||||
|
else
|
||||||
|
$CONDA/bin/python -m black qlib -l 120 --check --diff
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Unit tests with Pytest
|
- name: Unit tests with Pytest
|
||||||
run: |
|
run: |
|
||||||
cd tests
|
cd tests
|
||||||
pytest . --durations=0
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
$CONDA\\python.exe -m pytest . --durations=0
|
||||||
|
else
|
||||||
|
$CONDA/bin/python -m pytest . --durations=0
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Test data downloads
|
- name: Test data downloads
|
||||||
run: |
|
run: |
|
||||||
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
$CONDA\\python.exe scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
|
||||||
|
else
|
||||||
|
$CONDA/bin/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
|
- name: Test workflow by config
|
||||||
run: |
|
run: |
|
||||||
qrun examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||||
|
$CONDA\\python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
|
||||||
|
else
|
||||||
|
$CONDA/bin/python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|||||||
Reference in New Issue
Block a user