-
Notifications
You must be signed in to change notification settings - Fork 57
/
python_tests.sh
executable file
·40 lines (39 loc) · 1.4 KB
/
python_tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
if [[ $OS_NAME == "macos-latest" ]]; then
brew install gcc
curl -sL https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh
else
apt-get update
apt-get install --no-install-recommends -y \
apt-transport-https \
build-essential \
ca-certificates \
cmake \
curl \
gnupg-agent \
software-properties-common
if [[ $TASK != "R_PACKAGE" ]]; then
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install --no-install-recommends -y "g++-$GCC_VER_LINUX"
export CXX="g++-$GCC_VER_LINUX" && export CC="gcc-$GCC_VER_LINUX"
fi
curl -sL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o miniconda.sh
fi
bash miniconda.sh -b -p $CONDA_PATH
conda config --set always_yes yes --set changeps1 no
conda update -q conda
if [[ $TASK == "R_PACKAGE" ]]; then
conda create -q -n $CONDA_ENV python=$PYTHON_VERSION pip openssl libffi zlib --no-deps
source activate $CONDA_ENV
pip install setuptools joblib numpy scikit-learn scipy pandas wheel
else
conda create -q -n $CONDA_ENV python=$PYTHON_VERSION joblib numpy scikit-learn scipy pandas pytest
source activate $CONDA_ENV
fi
cd $GITHUB_WORKSPACE/python-package
python setup.py sdist --formats gztar || exit -1
pip install dist/rgf_python-$RGF_VER.tar.gz -v || exit -1
if [[ $TASK != "R_PACKAGE" ]]; then
pytest tests/ -v || exit -1
fi