|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - dev |
| 7 | + - master |
| 8 | + tags: |
| 9 | + - v* |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - "*" |
| 13 | + schedule: |
| 14 | + # Daily at 05:14 |
| 15 | + - cron: '14 5 * * *' |
| 16 | + |
| 17 | +jobs: |
| 18 | + test: |
| 19 | + # Should match JOB_NAME below |
| 20 | + name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 21 | + runs-on: ${{ matrix.os.runs-on }} |
| 22 | + container: ${{ matrix.os.container[matrix.python.docker] }} |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + task: |
| 27 | + - name: Test |
| 28 | + tox: test |
| 29 | + coverage: true |
| 30 | + os: |
| 31 | + - name: Linux |
| 32 | + runs-on: ubuntu-latest |
| 33 | + python_platform: linux |
| 34 | + matrix: linux |
| 35 | + container: |
| 36 | + 2.7: docker://python:2.7-buster |
| 37 | + 3.6: docker://python:3.6-buster |
| 38 | + 3.7: docker://python:3.7-buster |
| 39 | + 3.8: docker://python:3.8-buster |
| 40 | + 3.9: docker://python:3.9-buster |
| 41 | + pypy2: docker://pypy:2-jessie |
| 42 | + pypy3: docker://pypy:3-stretch |
| 43 | +# - name: Windows |
| 44 | +# runs-on: windows-latest |
| 45 | +# python_platform: win32 |
| 46 | +# matrix: windows |
| 47 | +# - name: macOS |
| 48 | +# runs-on: macos-latest |
| 49 | +# python_platform: darwin |
| 50 | +# matrix: macos |
| 51 | + python: |
| 52 | + - name: CPython 2.7 |
| 53 | + tox: py27 |
| 54 | + action: 2.7 |
| 55 | + docker: 2.7 |
| 56 | + implementation: cpython |
| 57 | + - name: PyPy 2.7 |
| 58 | + tox: pypy27 |
| 59 | + action: pypy-2.7 |
| 60 | + docker: pypy2.7 |
| 61 | + implementation: pypy |
| 62 | + - name: CPython 3.6 |
| 63 | + tox: py36 |
| 64 | + action: 3.6 |
| 65 | + docker: 3.6 |
| 66 | + implementation: cpython |
| 67 | + - name: CPython 3.7 |
| 68 | + tox: py37 |
| 69 | + action: 3.7 |
| 70 | + docker: 3.7 |
| 71 | + implementation: cpython |
| 72 | + - name: CPython 3.8 |
| 73 | + tox: py38 |
| 74 | + action: 3.8 |
| 75 | + docker: 3.8 |
| 76 | + implementation: cpython |
| 77 | + - name: CPython 3.9 |
| 78 | + tox: py39 |
| 79 | + action: 3.9 |
| 80 | + docker: 3.9 |
| 81 | + implementation: cpython |
| 82 | + - name: PyPy 3.6 |
| 83 | + tox: pypy36 |
| 84 | + action: pypy-3.6 |
| 85 | + docker: pypy3.6 |
| 86 | + implementation: pypy |
| 87 | + - name: PyPy 3.7 |
| 88 | + tox: pypy37 |
| 89 | + action: pypy-3.7 |
| 90 | + docker: pypy3.7 |
| 91 | + implementation: pypy |
| 92 | + arch: |
| 93 | + - name: x86 |
| 94 | + action: x86 |
| 95 | + matrix: x86 |
| 96 | + - name: x64 |
| 97 | + action: x64 |
| 98 | + matrix: x64 |
| 99 | + exclude: |
| 100 | + - os: |
| 101 | + matrix: linux |
| 102 | + arch: |
| 103 | + matrix: x86 |
| 104 | + - os: |
| 105 | + matrix: macos |
| 106 | + arch: |
| 107 | + matrix: x86 |
| 108 | + env: |
| 109 | + # Should match name above |
| 110 | + JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 111 | + steps: |
| 112 | + - uses: actions/checkout@v2 |
| 113 | + with: |
| 114 | + fetch-depth: 0 |
| 115 | + - name: Set up ${{ matrix.python.name }} (if CPython) |
| 116 | + if: ${{ job.container == '' && matrix.python.implementation == 'cpython'}} |
| 117 | + uses: actions/setup-python@v2 |
| 118 | + with: |
| 119 | + python-version: '${{ matrix.python.action }}.0-alpha - ${{ matrix.python.action }}.X' |
| 120 | + architecture: '${{ matrix.arch.action }}' |
| 121 | + - name: Set up ${{ matrix.python.name }} (if PyPy) |
| 122 | + if: ${{ job.container == '' && matrix.python.implementation == 'pypy'}} |
| 123 | + uses: actions/setup-python@v2 |
| 124 | + with: |
| 125 | + python-version: '${{ matrix.python.action }}' |
| 126 | + architecture: '${{ matrix.arch.action }}' |
| 127 | + - name: Install |
| 128 | + run: | |
| 129 | + pip install --upgrade pip setuptools wheel |
| 130 | + pip install --upgrade tox |
| 131 | + - uses: twisted/python-info-action@v1.0.1 |
| 132 | + - name: Test |
| 133 | + run: | |
| 134 | + tox -vv -e ${{ matrix.python.tox }} |
| 135 | + - name: Coverage Processing |
| 136 | + if: matrix.task.coverage |
| 137 | + run: | |
| 138 | + mkdir coverage_reports |
| 139 | + cp .coverage "coverage_reports/.coverage.${{ env.JOB_NAME }}" |
| 140 | + cp coverage.xml "coverage_reports/coverage.${{ env.JOB_NAME }}.xml" |
| 141 | + - name: Upload Coverage |
| 142 | + if: matrix.task.coverage |
| 143 | + uses: actions/upload-artifact@v2 |
| 144 | + with: |
| 145 | + name: coverage |
| 146 | + path: coverage_reports/* |
| 147 | + check: |
| 148 | + # Should match JOB_NAME below |
| 149 | + name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 150 | + runs-on: ${{ matrix.os.runs-on }} |
| 151 | + container: ${{ matrix.os.container[matrix.python.docker] }} |
| 152 | + strategy: |
| 153 | + fail-fast: false |
| 154 | + matrix: |
| 155 | + task: |
| 156 | + - name: flake8 |
| 157 | + tox: flake8 |
| 158 | + continue_on_error: true |
| 159 | + - name: Docs |
| 160 | + tox: docs |
| 161 | + os: |
| 162 | + - name: Linux |
| 163 | + runs-on: ubuntu-latest |
| 164 | + python_platform: linux |
| 165 | + matrix: linux |
| 166 | + container: |
| 167 | + 3.8: docker://python:3.8-buster |
| 168 | + python: |
| 169 | + - name: CPython 3.8 |
| 170 | + tox: py38 |
| 171 | + action: 3.8 |
| 172 | + docker: 3.8 |
| 173 | + implementation: cpython |
| 174 | + arch: |
| 175 | + - name: x64 |
| 176 | + action: x64 |
| 177 | + matrix: x64 |
| 178 | + env: |
| 179 | + # Should match name above |
| 180 | + JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 181 | + steps: |
| 182 | + - uses: actions/checkout@v2 |
| 183 | + with: |
| 184 | + fetch-depth: 0 |
| 185 | + - name: Install |
| 186 | + run: | |
| 187 | + pip install --upgrade pip setuptools wheel |
| 188 | + pip install --upgrade tox |
| 189 | + - uses: twisted/python-info-action@v1.0.1 |
| 190 | + - name: Test |
| 191 | + continue-on-error: ${{ matrix.task.continue_on_error == true }} |
| 192 | + run: | |
| 193 | + tox -vv -e ${{ matrix.task.tox }} |
| 194 | + coverage: |
| 195 | + # Should match JOB_NAME below |
| 196 | + name: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 197 | + runs-on: ${{ matrix.os.runs-on }} |
| 198 | + needs: |
| 199 | + - test |
| 200 | + container: ${{ matrix.os.container[matrix.python.docker] }} |
| 201 | + strategy: |
| 202 | + fail-fast: false |
| 203 | + matrix: |
| 204 | + task: |
| 205 | + - name: Coverage |
| 206 | + tox: combined-coverage |
| 207 | + download_coverage: true |
| 208 | + os: |
| 209 | + - name: Linux |
| 210 | + runs-on: ubuntu-latest |
| 211 | + python_platform: linux |
| 212 | + matrix: linux |
| 213 | + container: |
| 214 | + 3.8: docker://python:3.8-buster |
| 215 | + python: |
| 216 | + - name: CPython 3.8 |
| 217 | + tox: py38 |
| 218 | + action: 3.8 |
| 219 | + docker: 3.8 |
| 220 | + implementation: cpython |
| 221 | + arch: |
| 222 | + - name: x64 |
| 223 | + action: x64 |
| 224 | + matrix: x64 |
| 225 | + env: |
| 226 | + # Should match name above |
| 227 | + JOB_NAME: ${{ matrix.task.name }} - ${{ matrix.os.name }} ${{ matrix.python.name }} ${{ matrix.arch.name }} |
| 228 | + steps: |
| 229 | + - uses: actions/checkout@v2 |
| 230 | + with: |
| 231 | + fetch-depth: 0 |
| 232 | + - name: Install |
| 233 | + run: | |
| 234 | + pip install --upgrade pip setuptools wheel |
| 235 | + pip install --upgrade tox |
| 236 | + pip install --upgrade six |
| 237 | + - uses: twisted/python-info-action@v1.0.1 |
| 238 | + - name: Download Coverage |
| 239 | + if: matrix.task.download_coverage |
| 240 | + uses: actions/download-artifact@v2 |
| 241 | + with: |
| 242 | + name: coverage |
| 243 | + path: coverage_reports |
| 244 | + - name: Test |
| 245 | + continue-on-error: ${{ matrix.task.continue_on_error == true }} |
| 246 | + run: | |
| 247 | + tox -vv -e ${{ matrix.task.tox }} |
| 248 | + all: |
| 249 | + name: All |
| 250 | + runs-on: ubuntu-latest |
| 251 | + needs: |
| 252 | + - check |
| 253 | + - coverage |
| 254 | + - test |
| 255 | + steps: |
| 256 | + - name: This |
| 257 | + shell: python |
| 258 | + run: | |
| 259 | + import this |
0 commit comments