Skip to content

Commit b7bcd44

Browse files
Fix CI Bug (microsoft#575)
Co-authored-by: yuxwang <[email protected]>
1 parent f5fb8bc commit b7bcd44

File tree

2 files changed

+52
-62
lines changed

2 files changed

+52
-62
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Test
22

33
on:
44
push:
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
16-
python-version: [3.6, 3.7, 3.8, 3.9]
16+
python-version: [3.6, 3.7, 3.8]
1717

1818
steps:
1919
- uses: actions/checkout@v2
@@ -25,90 +25,88 @@ jobs:
2525

2626
- name: Lint with Black
2727
run: |
28-
cd ..
2928
if [ "$RUNNER_OS" == "Windows" ]; then
30-
$CONDA\\python.exe -m pip install black
31-
$CONDA\\python.exe -m black qlib -l 120 --check --diff
29+
python.exe -m pip install black
30+
python.exe -m black qlib -l 120 --check --diff
3231
else
33-
sudo $CONDA/bin/python -m pip install black
34-
$CONDA/bin/python -m black qlib -l 120 --check --diff
32+
python -m pip install black
33+
python -m black qlib -l 120 --check --diff
3534
fi
3635
shell: bash
3736

38-
# Test Qlib installed with pip
3937
- name: Install Qlib with pip
4038
run: |
4139
if [ "$RUNNER_OS" == "Windows" ]; then
42-
$CONDA\\python.exe -m pip install numpy==1.19.5
43-
$CONDA\\python.exe -m pip install pyqlib --ignore-installed ruamel.yaml numpy --user
40+
python.exe -m pip install numpy==1.19.5
41+
python.exe -m pip install pyqlib --ignore-installed ruamel.yaml numpy --user
4442
else
45-
sudo $CONDA/bin/python -m pip install numpy==1.19.5
46-
sudo $CONDA/bin/python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
43+
python -m pip install numpy==1.19.5
44+
python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
4745
fi
4846
shell: bash
4947

5048
- name: Test data downloads
5149
run: |
5250
if [ "$RUNNER_OS" == "Windows" ]; then
53-
$CONDA\\python.exe scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
51+
python.exe scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
5452
else
55-
$CONDA/bin/python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
53+
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
5654
fi
5755
shell: bash
5856

5957
- name: Test workflow by config (install from pip)
6058
run: |
6159
if [ "$RUNNER_OS" == "Windows" ]; then
62-
$CONDA\\python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
63-
$CONDA\\python.exe -m pip uninstall -y pyqlib
60+
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
61+
python.exe -m pip uninstall -y pyqlib
6462
else
65-
$CONDA/bin/python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
66-
sudo $CONDA/bin/python -m pip uninstall -y pyqlib
63+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
64+
python -m pip uninstall -y pyqlib
6765
fi
6866
shell: bash
69-
70-
# Test Qlib installed from source
67+
68+
# Test Qlib installed from source
7169
- name: Install Qlib from source
7270
run: |
7371
if [ "$RUNNER_OS" == "Windows" ]; then
74-
$CONDA\\python.exe -m pip install --upgrade cython
75-
$CONDA\\python.exe -m pip install numpy jupyter jupyter_contrib_nbextensions
76-
$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
77-
$CONDA\\python.exe setup.py install
72+
python.exe -m pip install --upgrade cython
73+
python.exe -m pip install numpy jupyter jupyter_contrib_nbextensions
74+
python.exe -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
75+
python.exe setup.py install
7876
else
79-
sudo $CONDA/bin/python -m pip install --upgrade cython
80-
sudo $CONDA/bin/python -m pip install numpy jupyter jupyter_contrib_nbextensions
81-
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
82-
sudo $CONDA/bin/python setup.py install
77+
python -m pip install --upgrade cython
78+
python -m pip install numpy jupyter jupyter_contrib_nbextensions
79+
python -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
80+
python setup.py install
8381
fi
8482
shell: bash
8583

8684
- name: Install test dependencies
8785
run: |
8886
if [ "$RUNNER_OS" == "Windows" ]; then
89-
$CONDA\\python.exe -m pip install --upgrade pip
90-
$CONDA\\python.exe -m pip install black pytest
87+
python.exe -m pip install --upgrade pip
88+
python.exe -m pip install black pytest
9189
else
92-
sudo $CONDA/bin/python -m pip install --upgrade pip
93-
sudo $CONDA/bin/python -m pip install black pytest
90+
python -m pip install --upgrade pip
91+
python -m pip install black pytest
9492
fi
95-
shell: bash
93+
shell: bash
9694

9795
- name: Unit tests with Pytest
9896
run: |
9997
cd tests
10098
if [ "$RUNNER_OS" == "Windows" ]; then
101-
$CONDA\\python.exe -m pytest . --durations=0
99+
python.exe -m pytest . --durations=0
102100
else
103-
$CONDA/bin/python -m pytest . --durations=0
101+
python -m pytest . --durations=0
104102
fi
105103
shell: bash
106104

107105
- name: Test workflow by config (install from source)
108106
run: |
109107
if [ "$RUNNER_OS" == "Windows" ]; then
110-
$CONDA\\python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
108+
python.exe qlib\\workflow\\cli.py examples\\benchmarks\\LightGBM\\workflow_config_lightgbm_Alpha158.yaml
111109
else
112-
$CONDA/bin/python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
110+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
113111
fi
114112
shell: bash

.github/workflows/test_macos.yml

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: macos-latest
1414
strategy:
1515
matrix:
16-
python-version: [3.6, 3.7, 3.8, 3.9]
16+
python-version: [3.6, 3.7, 3.8]
1717

1818
steps:
1919
- uses: actions/checkout@v2
@@ -26,48 +26,40 @@ jobs:
2626
- name: Lint with Black
2727
run: |
2828
cd ..
29-
sudo $CONDA/bin/python -m pip install black
30-
$CONDA/bin/python -m black qlib -l 120 --check --diff
31-
29+
python -m pip install black
30+
python -m black qlib -l 120 --check --diff
3231
# Test Qlib installed with pip
3332
- name: Install Qlib with pip
3433
run: |
35-
sudo $CONDA/bin/python -m pip install numpy==1.19.5
36-
sudo $CONDA/bin/python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
37-
34+
python -m pip install numpy==1.19.5
35+
python -m pip install pyqlib --ignore-installed ruamel.yaml numpy
3836
- name: Install Lightgbm for MacOS
3937
run: |
4038
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Microsoft/qlib/main/.github/brew_install.sh)"
4139
HOMEBREW_NO_AUTO_UPDATE=1 brew install lightgbm
42-
4340
- name: Test data downloads
4441
run: |
45-
$CONDA/bin/python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
46-
42+
python scripts/get_data.py qlib_data --target_dir ~/.qlib/qlib_data/cn_data --interval 1d --region cn
4743
- name: Test workflow by config (install from pip)
4844
run: |
49-
$CONDA/bin/python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
50-
sudo $CONDA/bin/python -m pip uninstall -y pyqlib
51-
45+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
46+
python -m pip uninstall -y pyqlib
5247
# Test Qlib installed from source
5348
- name: Install Qlib from source
5449
run: |
55-
sudo $CONDA/bin/python -m pip install --upgrade cython
56-
sudo $CONDA/bin/python -m pip install numpy jupyter jupyter_contrib_nbextensions
57-
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
58-
sudo $CONDA/bin/python setup.py install
59-
50+
python -m pip install --upgrade cython
51+
python -m pip install numpy jupyter jupyter_contrib_nbextensions
52+
python -m pip install -U scipy scikit-learn # installing without this line will cause errors on GitHub Actions, while instsalling locally won't
53+
python setup.py install
6054
- name: Install test dependencies
6155
run: |
62-
sudo $CONDA/bin/python -m pip install --upgrade pip
63-
sudo $CONDA/bin/python -m pip install -U pyopenssl idna
64-
sudo $CONDA/bin/python -m pip install black pytest
65-
56+
python -m pip install --upgrade pip
57+
python -m pip install -U pyopenssl idna
58+
python -m pip install black pytest
6659
- name: Unit tests with Pytest
6760
run: |
6861
cd tests
69-
$CONDA/bin/python -m pytest . --durations=0
70-
62+
python -m pytest . --durations=0
7163
- name: Test workflow by config (install from source)
7264
run: |
73-
$CONDA/bin/python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml
65+
python qlib/workflow/cli.py examples/benchmarks/LightGBM/workflow_config_lightgbm_Alpha158.yaml

0 commit comments

Comments
 (0)