|
| 1 | +name: Run Tox Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + strategy: |
| 12 | + max-parallel: 4 |
| 13 | + matrix: |
| 14 | + include: |
| 15 | + - python-version: 2.7 |
| 16 | + - python-version: 3.4 |
| 17 | + - python-version: 3.5 |
| 18 | + - python-version: 3.6 |
| 19 | + - python-version: 3.7 |
| 20 | + # 0.14.0 is the last version with the old categorical system |
| 21 | + # libfortran=1.0 is needed to work around a bug in anaconda |
| 22 | + # (https://github.com/pydata/patsy/pull/83#issuecomment-206895923) |
| 23 | + - python-version: 2.7 |
| 24 | + pandas-version-string: "=0.14.0 libgfortran=1.0" |
| 25 | + - python-version: 3.4 |
| 26 | + pandas-version-string: "=0.14.0 libgfortran=1.0" |
| 27 | + # 0.18.0 has is_categorical_dtype in a different place than 0.19.0+ |
| 28 | + - env: |
| 29 | + - python-version: 3.4 |
| 30 | + - pandas-version-string: "=0.18.0" |
| 31 | + - env: |
| 32 | + - python-version: 2.7 |
| 33 | + - pandas-version-string: "=0.18.0" |
| 34 | + # make sure it works without pandas |
| 35 | + - env: |
| 36 | + - python-version: 2.7 |
| 37 | + - pandas-version-string: "NONE" |
| 38 | + - env: |
| 39 | + - python-version: 3.6 |
| 40 | + - pandas-version-string: "NONE" |
| 41 | + - env: |
| 42 | + - python-version: 3.7 |
| 43 | + - pandas-version-string: "NONE" |
| 44 | + env: |
| 45 | + PYTHON_VERSION: ${{ matrix.python-version }} |
| 46 | + PANDAS_VERSION_STR: ${{ matrix.pandas-version-string }} |
| 47 | + # Work around terrible pathological behaviour in OpenBLAS multithreading, that causes execution time to blow up from 3 minutes to 18 minutes, apparently in SVD on smallish matrices |
| 48 | + OMP_NUM_THREADS: 1 |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v1 |
| 51 | + - name: Set up Miniconda environment for Python ${{ matrix.python-version }} |
| 52 | + uses: conda-incubator/setup-miniconda@v2 |
| 53 | + with: |
| 54 | + miniforge-variant: Mambaforge |
| 55 | + activate-environment: patsy |
| 56 | + auto-update-conda: true |
| 57 | + channels: conda-forge |
| 58 | + channel-priority: flexible |
| 59 | + python-version: ${{ matrix.python-version }} |
| 60 | + - name: Install conda dependencies |
| 61 | + shell: bash -l {0} |
| 62 | + run: | |
| 63 | + export PKGS="numpy scipy coverage nose pip" |
| 64 | + if [ "$PANDAS_VERSION_STR" != "NONE" ]; then export PKGS="${PKGS} pandas${PANDAS_VERSION_STR}"; fi |
| 65 | + mamba install -y $PKGS |
| 66 | + - name: Install patsy |
| 67 | + shell: bash -l {0} |
| 68 | + run: | |
| 69 | + python setup.py sdist |
| 70 | + pip install dist/* |
| 71 | + - name: Run tests |
| 72 | + shell: bash -l {0} |
| 73 | + run: | |
| 74 | + mkdir empty |
| 75 | + cd empty |
| 76 | + INSTALLDIR=$(python -c "import os; import patsy; print(os.path.dirname(patsy.__file__))") |
| 77 | + export PYTHONWARNINGS=default PATSY_FORCE_NO_WARNINGS=1 |
| 78 | + # The --exe is because python sometimes marks all installed modules |
| 79 | + # as executable, so without --exe nosetests will just ignore |
| 80 | + # everything. Baffling, but so it goes. |
| 81 | + coverage run --source=$INSTALLDIR --rcfile=../.coveragerc $(which nosetests) -vvv --nocapture --exe --failure-detail --all-modules $INSTALLDIR |
| 82 | + coverage report --rcfile=../.coveragerc --show-missing |
| 83 | + python ../tools/check-API-refs.py |
| 84 | + - name: Upload coverage to Codecov |
| 85 | + uses: codecov/codecov-action@v1.0.10 |
| 86 | + with: |
| 87 | + file: ./coverage.xml |
| 88 | + flags: unittests |
| 89 | + env_vars: PYTHON_VERSION,PANDAS_VERSION_STR |
0 commit comments