mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 05:51:17 +08:00
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [windows-latest, ubuntu-18.04, ubuntu-20.04]
|
|
# not supporting 3.6 due to annotations is not supported https://stackoverflow.com/a/52890129
|
|
python-version: [3.7, 3.8]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Lint with Black
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install black wheel
|
|
black qlib -l 120 --check --diff
|
|
|
|
- name: Install Qlib with pip
|
|
run: |
|
|
pip install numpy==1.19.5 ruamel.yaml
|
|
pip install pyqlib --ignore-installed
|
|
|
|
- name: Test data downloads
|
|
run: |
|
|
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
|
|
|
|
- name: Test workflow by config (install from pip)
|
|
run: |
|
|
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
|
python -m pip uninstall -y pyqlib
|
|
|
|
# Test Qlib installed from source
|
|
- name: Install Qlib from source
|
|
run: |
|
|
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
|
|
pip install -e .
|
|
|
|
- name: Install test dependencies
|
|
run: |
|
|
pip install --upgrade pip
|
|
pip install black pytest
|
|
|
|
- name: Unit tests with Pytest
|
|
run: |
|
|
cd tests
|
|
python -m pytest . --durations=10
|
|
|
|
- name: Test workflow by config (install from source)
|
|
run: |
|
|
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
|
|
|