|
| 1 | +name: GH Actions CI |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - develop |
| 6 | + - master |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - develop |
| 10 | + - master |
| 11 | + |
| 12 | +concurrency: |
| 13 | + # Probably overly cautious group naming. |
| 14 | + # Commits to develop/master will cancel each other, but PRs will only cancel |
| 15 | + # commits within the same PR |
| 16 | + group: "${{ github.ref }}-${{ github.head_ref }}" |
| 17 | + cancel-in-progress: true |
| 18 | + |
| 19 | +defaults: |
| 20 | + run: |
| 21 | + shell: bash -l {0} |
| 22 | + |
| 23 | +jobs: |
| 24 | + unittests: |
| 25 | + if: "github.repository == 'MDAnalysis/pmda'" |
| 26 | + runs-on: ${{ matrix.os }} |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + os: [ubuntu-latest, ] |
| 31 | + python-version: [2.7, 3.7, 3.8] |
| 32 | + include: |
| 33 | + - name: macOS_bigsur_py39 |
| 34 | + os: macOS-11 |
| 35 | + python-version: 3.8 |
| 36 | + - name: macOS_catalina_py37 |
| 37 | + os: macOS-10.15 |
| 38 | + python-version: 3.7 |
| 39 | + env: |
| 40 | + CYTHON_TRACE_NOGIL: 1 |
| 41 | + MPLBACKEND: agg |
| 42 | + GH_OS: ${{ matrix.os }} |
| 43 | + |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + |
| 47 | + - name: setup_miniconda |
| 48 | + uses: conda-incubator/setup-miniconda@v2 |
| 49 | + with: |
| 50 | + python-version: ${{ matrix.python-version }} |
| 51 | + auto-update-conda: true |
| 52 | + channel-priority: flexible |
| 53 | + # The order of these channel matters: both provide "fundamental" |
| 54 | + # software (curl, ssh, ...), but the version in biobuilds are very |
| 55 | + # outdated. This can lead to problem when loading shared libraries, |
| 56 | + # see https://github.com/MDAnalysis/mdanalysis/pull/3126#issuecomment-813112080 |
| 57 | + channels: conda-forge, biobuilds |
| 58 | + add-pip-as-python-dependency: true |
| 59 | + mamba-version: "*" |
| 60 | + architecture: x64 |
| 61 | + |
| 62 | + - name: install_deps |
| 63 | + run: | |
| 64 | + mamba install 'mdanalysis>=1.1.1,<2' 'mdanalysistests>=1.1.1,<2' dask distributed joblib mock codecov |
| 65 | + pip install 'coverage<5' 'pytest-cov==2.10.1' pytest-xdist |
| 66 | +
|
| 67 | + - name: check_setup |
| 68 | + run: | |
| 69 | + # Check OS and python setup |
| 70 | + echo "OS: ${OS_NAME}" |
| 71 | + which python |
| 72 | + which pip |
| 73 | + pip list |
| 74 | + conda info |
| 75 | + conda list |
| 76 | +
|
| 77 | + - name: install PMDA package |
| 78 | + run: python -m pip install -v . |
| 79 | + |
| 80 | + - name: run tests |
| 81 | + run: | |
| 82 | + pytest -v --cov=pmda --cov-report=xml --color=yes ./pmda/test |
| 83 | +
|
| 84 | + - name: codecov |
| 85 | + uses: codecov/codecov-action@v2 |
| 86 | + with: |
| 87 | + file: coverage.xml |
| 88 | + fail_ci_if_error: True |
| 89 | + verbose: True |
| 90 | + |
| 91 | + pylint_check: |
| 92 | + if: "github.repository == 'MDAnalysis/pmda'" |
| 93 | + runs-on: ubuntu-latest |
| 94 | + |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v2 |
| 97 | + |
| 98 | + - name: setup_miniconda |
| 99 | + uses: conda-incubator/setup-miniconda@v2 |
| 100 | + with: |
| 101 | + python-version: 3.7 |
| 102 | + auto-update-conda: true |
| 103 | + channel-priority: flexible |
| 104 | + channels: conda-forge |
| 105 | + add-pip-as-python-dependency: true |
| 106 | + architecture: x64 |
| 107 | + |
| 108 | + - name: install |
| 109 | + run: | |
| 110 | + which pip |
| 111 | + which python |
| 112 | + pip install pylint |
| 113 | +
|
| 114 | + - name: pylint |
| 115 | + env: |
| 116 | + PYLINTRC: .pylintrc |
| 117 | + run: | |
| 118 | + pylint pmda |
| 119 | +
|
| 120 | +
|
| 121 | + pypi_check: |
| 122 | + if: "github.repository == 'MDAnalysis/pmda'" |
| 123 | + runs-on: ubuntu-latest |
| 124 | + |
| 125 | + steps: |
| 126 | + - uses: actions/checkout@v2 |
| 127 | + |
| 128 | + - name: setup_miniconda |
| 129 | + uses: conda-incubator/setup-miniconda@v2 |
| 130 | + with: |
| 131 | + python-version: 3.7 |
| 132 | + auto-update-conda: true |
| 133 | + channel-priority: flexible |
| 134 | + channels: conda-forge |
| 135 | + add-pip-as-python-dependency: true |
| 136 | + # mamba not enabled as install longer than deps install |
| 137 | + architecture: x64 |
| 138 | + |
| 139 | + - name: install_conda |
| 140 | + run: | |
| 141 | + conda install setuptools twine |
| 142 | +
|
| 143 | + - name: install PMDA |
| 144 | + run: | |
| 145 | + python setup.py sdist |
| 146 | +
|
| 147 | + - name: check package build |
| 148 | + run: | |
| 149 | + DISTRIBUTION=$(ls -t1 dist/pmda-*.tar.gz | head -n 1) |
| 150 | + test -n "${DISTRIBUTION}" || { echo "no distribution dist/pmda-*.tar.gz found"; exit 1; } |
| 151 | + echo "twine check $DISTRIBUTION" |
| 152 | + twine check $DISTRIBUTION |
0 commit comments