83 lines (79 loc) · 2.9 KB
/
pytest.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Tests
on: [push, pull_request]
jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
use-conda: [true, false]
use-dist: [false]
include:
- python-version: 3.8
code-cov: true
- python-version: 3.7
use-conda: false
use-dist: true
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Conda Install test dependencies
if: matrix.use-conda == true
run: |
# Miniconda is available in $CONDA env var
$CONDA/bin/conda create -n testenv --yes pip wheel gxx_linux-64 gcc_linux-64 swig python=${{ matrix.python-version }}
$CONDA/envs/testenv/bin/python3 -m pip install --upgrade pip
$CONDA/envs/testenv/bin/pip3 install -e .[test]
- name: Install test dependencies
if: matrix.use-conda == false && matrix.use-dist == false
run: |
python -m pip install --upgrade pip
pip install -e .[test]
sudo apt-get update
sudo apt-get remove swig
sudo apt-get install swig3.0
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
- name: Dist Install test dependencies
if: matrix.use-conda == false && matrix.use-dist == true
run: |
python -m pip install --upgrade pip
sudo apt-get update
sudo apt-get remove swig
sudo apt-get install swig3.0
sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
# We need to install for the dependencies, like pytest
pip install -e .[test]
# Then we remove autosklearn and install from DIST
pip uninstall --yes auto-sklearn
python setup.py sdist
last_dist=$(ls -t dist/auto-sklearn-*.tar.gz | head -n 1)
pip install $last_dist
- name: Conda Run tests
if: matrix.use-conda == true
run: |
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
# We activate conda as metalearning uses python directly, so we need
# to change the default python
export PATH="$CONDA/envs/testenv/bin:$PATH"
if [ ${{ matrix.code-cov }} ]; then codecov='--cov=autosklearn --cov-report=xml'; fi
$CONDA/envs/testenv/bin/python3 -m pytest --durations=20 -sv $codecov test
- name: Run tests
if: matrix.use-conda == false
run: |
export OPENBLAS_NUM_THREADS=1
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
if [ ${{ matrix.code-cov }} ]; then codecov='--cov=autosklearn --cov-report=xml'; fi
pytest --durations=20 -sv $codecov test
- name: Upload coverage
if: matrix.code-cov && always()
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true