Skip to content

Commit 28c99c7

Browse files
authored
test.yml: Remove redundant code (#595)
1 parent bb5cdfe commit 28c99c7

1 file changed

Lines changed: 15 additions & 66 deletions

File tree

.github/workflows/test.yml

Lines changed: 15 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -25,92 +25,41 @@ jobs:
2525

2626
- name: Lint with Black
2727
run: |
28-
if [ "$RUNNER_OS" == "Windows" ]; then
29-
python.exe -m pip install pip --upgrade
30-
python.exe -m pip install wheel --upgrade
31-
python.exe -m pip install black
32-
python.exe -m black qlib -l 120 --check --diff
33-
else
34-
python -m pip install pip --upgrade
35-
python -m pip install wheel --upgrade
36-
python -m pip install black
37-
python -m black qlib -l 120 --check --diff
38-
fi
39-
shell: bash
28+
pip install --upgrade pip
29+
pip install black wheel
30+
black qlib -l 120 --check --diff
4031
4132
- name: Install Qlib with pip
4233
run: |
43-
if [ "$RUNNER_OS" == "Windows" ]; then
44-
python.exe -m pip install numpy==1.19.5
45-
python.exe -m pip install pyqlib --ignore-installed ruamel.yaml numpy --user
46-
else
47-
python -m pip install numpy==1.19.5
48-
python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
49-
fi
50-
shell: bash
34+
pip install numpy==1.19.5 ruamel.yaml
35+
pip install pyqlib --ignore-installed
5136
5237
- name: Test data downloads
5338
run: |
54-
if [ "$RUNNER_OS" == "Windows" ]; then
55-
python.exe scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
56-
else
57-
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
58-
fi
59-
shell: bash
39+
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
6040
6141
- name: Test workflow by config (install from pip)
6242
run: |
63-
if [ "$RUNNER_OS" == "Windows" ]; then
64-
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
65-
python.exe -m pip uninstall -y pyqlib
66-
else
67-
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
68-
python -m pip uninstall -y pyqlib
69-
fi
70-
shell: bash
43+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
44+
python -m pip uninstall -y pyqlib
7145
7246
# Test Qlib installed from source
7347
- name: Install Qlib from source
7448
run: |
75-
if [ "$RUNNER_OS" == "Windows" ]; then
76-
python.exe -m pip install --upgrade cython
77-
python.exe -m pip install numpy jupyter jupyter_contrib_nbextensions
78-
python.exe -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
79-
python.exe setup.py install
80-
else
81-
python -m pip install --upgrade cython
82-
python -m pip install numpy jupyter jupyter_contrib_nbextensions
83-
python -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
84-
python setup.py install
85-
fi
86-
shell: bash
49+
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
50+
pip install -e .
8751
8852
- name: Install test dependencies
8953
run: |
90-
if [ "$RUNNER_OS" == "Windows" ]; then
91-
python.exe -m pip install --upgrade pip
92-
python.exe -m pip install black pytest
93-
else
94-
python -m pip install --upgrade pip
95-
python -m pip install black pytest
96-
fi
97-
shell: bash
54+
pip install --upgrade pip
55+
pip install black pytest
9856
9957
- name: Unit tests with Pytest
10058
run: |
10159
cd tests
102-
if [ "$RUNNER_OS" == "Windows" ]; then
103-
python.exe -m pytest . --durations=0
104-
else
105-
python -m pytest . --durations=0
106-
fi
107-
shell: bash
60+
python -m pytest . --durations=10
10861
10962
- name: Test workflow by config (install from source)
11063
run: |
111-
if [ "$RUNNER_OS" == "Windows" ]; then
112-
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
113-
else
114-
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
115-
fi
116-
shell: bash
64+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
65+

0 commit comments

Comments
 (0)