|
| 1 | +name: flopy continuous integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + |
| 9 | + flopy_lint: |
| 10 | + name: linting |
| 11 | + runs-on: ubuntu-latest |
| 12 | + strategy: |
| 13 | + fail-fast: false |
| 14 | + steps: |
| 15 | + |
| 16 | + # check out repo |
| 17 | + - name: Checkout flopy repo |
| 18 | + uses: actions/checkout@v2 |
| 19 | + |
| 20 | + # Standard python fails on windows without GDAL installation. Using |
| 21 | + # standard python here since only linting on linux. |
| 22 | + # Use standard bash shell with standard python |
| 23 | + - name: Setup Python 3.8 |
| 24 | + uses: actions/setup-python@v2 |
| 25 | + with: |
| 26 | + python-version: 3.8 |
| 27 | + |
| 28 | + - name: Print python version |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + python --version |
| 32 | +
|
| 33 | + - name: Install Python 3.8 packages |
| 34 | + shell: bash |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + pip install -r requirements.pip.txt |
| 38 | +
|
| 39 | + - name: Run black |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + echo "if black check fails run" |
| 43 | + echo " black --line-length 79 ./flopy" |
| 44 | + echo "and then commit the changes." |
| 45 | + black --check --line-length 79 ./flopy |
| 46 | +
|
| 47 | + - name: Run flake8 |
| 48 | + shell: bash |
| 49 | + run: | |
| 50 | + flake8 --count --show-source --exit-zero ./flopy |
| 51 | +
|
| 52 | + - name: Run pylint |
| 53 | + shell: bash |
| 54 | + run: | |
| 55 | + pylint --jobs=2 --errors-only --exit-zero ./flopy |
| 56 | +
|
| 57 | + flopyScriptNotebookCI: |
| 58 | + name: additional tests |
| 59 | + needs: flopy_lint |
| 60 | + runs-on: ubuntu-latest |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: |
| 64 | + test-file: [autotest_notebooks.py, autotest_scripts.py] |
| 65 | + steps: |
| 66 | + # check out repo |
| 67 | + - name: Checkout flopy repo |
| 68 | + uses: actions/checkout@v2 |
| 69 | + |
| 70 | + # Standard python fails on windows without GDAL installation |
| 71 | + # Using custom bash shell ("shell: bash -l {0}") with Miniconda |
| 72 | + - name: Setup Miniconda |
| 73 | + uses: goanpeca/setup-miniconda@v1.6.0 |
| 74 | + with: |
| 75 | + python-version: 3.8 |
| 76 | + activate-environment: flopy |
| 77 | + auto-update-conda: true |
| 78 | + environment-file: environment.yml |
| 79 | + |
| 80 | + - name: Determine python environment |
| 81 | + shell: bash -l {0} |
| 82 | + run: | |
| 83 | + conda info |
| 84 | + conda list |
| 85 | +
|
| 86 | + - name: Install additional Python 3.8 packages |
| 87 | + if: matrix.test-file == 'autotest_notebooks.py' |
| 88 | + shell: bash -l {0} |
| 89 | + run: | |
| 90 | + conda install nbconvert jupyter |
| 91 | +
|
| 92 | + - name: Install xmipy, pymake, and flopy |
| 93 | + shell: bash -l {0} |
| 94 | + run: | |
| 95 | + pip install xmipy |
| 96 | + pip install . |
| 97 | + pip install https://github.com/modflowpy/pymake/zipball/master |
| 98 | +
|
| 99 | + - name: Download executables needed for tests |
| 100 | + shell: bash -l {0} |
| 101 | + run: | |
| 102 | + python ./autotest/get_exes.py |
| 103 | +
|
| 104 | + - name: Add executables directory to path |
| 105 | + shell: bash |
| 106 | + run: | |
| 107 | + echo "::add-path::$HOME/.local/bin" |
| 108 | +
|
| 109 | + - name: Run ${{ matrix.test-file }} CI |
| 110 | + shell: bash -l {0} |
| 111 | + run: | |
| 112 | + coverage run -m nose -v ${{ matrix.test-file }} --with-id --with-timer \ |
| 113 | + --with-coverage --cover-package=flopy --cover-xml \ |
| 114 | + --cover-xml-file=../coverage.xml -w ./autotest |
| 115 | +
|
| 116 | + - name: List files in the root directory |
| 117 | + shell: bash |
| 118 | + run: | |
| 119 | + ls -l |
| 120 | +
|
| 121 | + - name: Upload coverage to Codecov |
| 122 | + uses: codecov/codecov-action@v1.0.12 |
| 123 | + with: |
| 124 | + file: ./coverage.xml |
| 125 | + |
| 126 | + flopyCI: |
| 127 | + name: autotests |
| 128 | + needs: flopy_lint |
| 129 | + runs-on: ${{ matrix.os }} |
| 130 | + strategy: |
| 131 | + fail-fast: false |
| 132 | + matrix: |
| 133 | + python-version: [3.8, 3.7, 3.6] |
| 134 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 135 | + |
| 136 | + steps: |
| 137 | + # check out repo |
| 138 | + - name: Checkout flopy repo |
| 139 | + uses: actions/checkout@v2 |
| 140 | + |
| 141 | + # Standard python fails on windows without GDAL installation |
| 142 | + # Using custom bash shell ("shell: bash -l {0}") with Miniconda |
| 143 | + - name: Setup Miniconda |
| 144 | + uses: goanpeca/setup-miniconda@v1.6.0 |
| 145 | + with: |
| 146 | + python-version: ${{ matrix.python-version }} |
| 147 | + activate-environment: flopy |
| 148 | + auto-update-conda: true |
| 149 | + environment-file: environment.yml |
| 150 | + |
| 151 | + - name: Determine python environment |
| 152 | + shell: bash -l {0} |
| 153 | + run: | |
| 154 | + conda info |
| 155 | + conda list |
| 156 | +
|
| 157 | + - name: Install xmipy, pymake, and flopy |
| 158 | + shell: bash -l {0} |
| 159 | + run: | |
| 160 | + pip install xmipy |
| 161 | + pip install . |
| 162 | + pip install https://github.com/modflowpy/pymake/zipball/master |
| 163 | +
|
| 164 | + - name: Download executables needed for tests |
| 165 | + shell: bash -l {0} |
| 166 | + run: | |
| 167 | + python ./autotest/get_exes.py |
| 168 | +
|
| 169 | + - name: Add executables directory to path |
| 170 | + shell: bash |
| 171 | + run: | |
| 172 | + echo "::add-path::$HOME/.local/bin" |
| 173 | +
|
| 174 | + - name: Run nosetests |
| 175 | + shell: bash -l {0} |
| 176 | + run: | |
| 177 | + coverage run -m nose -v --with-id --with-timer \ |
| 178 | + --with-coverage --cover-package=flopy --cover-xml \ |
| 179 | + --cover-xml-file=../coverage.xml -w ./autotest |
| 180 | +
|
| 181 | + - name: List files in the root directory |
| 182 | + shell: bash |
| 183 | + run: | |
| 184 | + ls -l |
| 185 | +
|
| 186 | + - name: Upload coverage to Codecov |
| 187 | + uses: codecov/codecov-action@v1.0.12 |
| 188 | + with: |
| 189 | + file: ./coverage.xml |
0 commit comments