|
| 1 | +# evaluating GitHub actions for CI, disregard failures when evaluating PRs |
| 2 | +# |
| 3 | +# this is still missing: |
| 4 | +# - deploy |
| 5 | +# - upload github notes |
| 6 | +# |
| 7 | +name: main |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - 4.6.x |
| 13 | + tags: |
| 14 | + - "*" |
| 15 | + |
| 16 | + pull_request: |
| 17 | + branches: |
| 18 | + - 4.6.x |
| 19 | + |
| 20 | +jobs: |
| 21 | + build: |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + name: [ |
| 28 | + "windows-py27", |
| 29 | + "windows-py35", |
| 30 | + "windows-py36", |
| 31 | + "windows-py37", |
| 32 | + "windows-py37-pluggy", |
| 33 | + "windows-py38", |
| 34 | + |
| 35 | + "ubuntu-py37", |
| 36 | + "ubuntu-py37-pluggy", |
| 37 | + "ubuntu-py37-pexpect", |
| 38 | + "ubuntu-py37-freeze", |
| 39 | + "ubuntu-pypy", |
| 40 | + "ubuntu-pypy3", |
| 41 | + |
| 42 | + "macos-py27", |
| 43 | + "macos-py38", |
| 44 | + |
| 45 | + ] |
| 46 | + |
| 47 | + include: |
| 48 | + # Windows jobs |
| 49 | + - name: "windows-py27" |
| 50 | + python: "2.7" |
| 51 | + os: windows-latest |
| 52 | + tox_env: "py27-xdist" |
| 53 | + use_coverage: true |
| 54 | + arch: "x64" |
| 55 | + - name: "windows-py35" |
| 56 | + python: "3.5" |
| 57 | + os: windows-latest |
| 58 | + tox_env: "py35-xdist" |
| 59 | + arch: "x64" |
| 60 | + - name: "windows-py36" |
| 61 | + python: "3.6" |
| 62 | + os: windows-latest |
| 63 | + tox_env: "py36-xdist" |
| 64 | + arch: "x64" |
| 65 | + - name: "windows-py37" |
| 66 | + python: "3.7" |
| 67 | + os: windows-latest |
| 68 | + tox_env: "py37-twisted-numpy" |
| 69 | + arch: "x64" |
| 70 | + - name: "windows-py37-pluggy" |
| 71 | + python: "3.7" |
| 72 | + os: windows-latest |
| 73 | + tox_env: "py37-pluggymaster-xdist" |
| 74 | + arch: "x64" |
| 75 | + - name: "windows-py38" |
| 76 | + python: "3.8" |
| 77 | + os: windows-latest |
| 78 | + tox_env: "py38" |
| 79 | + use_coverage: true |
| 80 | + arch: "x64" |
| 81 | + |
| 82 | + # Ubuntu jobs – find the rest of them in .travis.yml |
| 83 | + - name: "ubuntu-py37" |
| 84 | + python: "3.7" |
| 85 | + os: ubuntu-latest |
| 86 | + tox_env: "py37-lsof-numpy-xdist" |
| 87 | + use_coverage: true |
| 88 | + arch: "x64" |
| 89 | + - name: "ubuntu-py37-pluggy" |
| 90 | + python: "3.7" |
| 91 | + os: ubuntu-latest |
| 92 | + tox_env: "py37-pluggymaster-xdist" |
| 93 | + arch: "x64" |
| 94 | + - name: "ubuntu-py37-pexpect" |
| 95 | + python: "3.7" |
| 96 | + os: ubuntu-latest |
| 97 | + tox_env: "py37-pexpect" |
| 98 | + use_coverage: true |
| 99 | + arch: "x64" |
| 100 | + - name: "ubuntu-py37-freeze" |
| 101 | + python: "3.7" |
| 102 | + os: ubuntu-latest |
| 103 | + tox_env: "py37-freeze" |
| 104 | + arch: "x64" |
| 105 | + - name: "ubuntu-pypy" |
| 106 | + python: "pypy2" |
| 107 | + os: ubuntu-latest |
| 108 | + tox_env: "pypy-xdist" |
| 109 | + arch: "x64" |
| 110 | + - name: "ubuntu-pypy3" |
| 111 | + python: "pypy3" |
| 112 | + os: ubuntu-latest |
| 113 | + tox_env: "pypy3-xdist" |
| 114 | + arch: "x64" |
| 115 | + |
| 116 | + # MacOS jobs |
| 117 | + - name: "macos-py27" |
| 118 | + python: "2.7" |
| 119 | + os: macos-latest |
| 120 | + tox_env: "py27-xdist" |
| 121 | + use_coverage: true |
| 122 | + arch: "x64" |
| 123 | + - name: "macos-py38" |
| 124 | + python: "3.8" |
| 125 | + os: macos-latest |
| 126 | + tox_env: "py38-xdist" |
| 127 | + use_coverage: true |
| 128 | + arch: "x64" |
| 129 | + |
| 130 | + steps: |
| 131 | + - uses: actions/checkout@v1 |
| 132 | + - name: Set up Python ${{ matrix.python }} on ${{ matrix.os }} |
| 133 | + uses: actions/setup-python@v1 |
| 134 | + with: |
| 135 | + python-version: ${{ matrix.python }} |
| 136 | + architecture: ${{ matrix.arch }} |
| 137 | + - name: Install dependencies |
| 138 | + run: | |
| 139 | + python -m pip install --upgrade pip |
| 140 | + pip install tox coverage |
| 141 | + - name: Test without coverage |
| 142 | + if: "! matrix.use_coverage" |
| 143 | + run: "tox -e ${{ matrix.tox_env }}" |
| 144 | + |
| 145 | + - name: Test with coverage |
| 146 | + if: "matrix.use_coverage" |
| 147 | + env: |
| 148 | + _PYTEST_TOX_COVERAGE_RUN: "coverage run -m" |
| 149 | + COVERAGE_PROCESS_START: ".coveragerc" |
| 150 | + _PYTEST_TOX_EXTRA_DEP: "coverage-enable-subprocess" |
| 151 | + run: "tox -e ${{ matrix.tox_env }}" |
| 152 | + |
| 153 | + - name: Prepare coverage token |
| 154 | + if: (matrix.use_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' )) |
| 155 | + run: | |
| 156 | + python scripts/append_codecov_token.py |
| 157 | + - name: Report coverage |
| 158 | + if: (matrix.use_coverage) |
| 159 | + env: |
| 160 | + CODECOV_NAME: ${{ matrix.name }} |
| 161 | + run: bash scripts/report-coverage.sh -F GHA,${{ runner.os }} |
| 162 | + |
| 163 | + deploy: |
| 164 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && github.repository == 'pytest-dev/pytest' |
| 165 | + |
| 166 | + runs-on: ubuntu-latest |
| 167 | + |
| 168 | + needs: [build] |
| 169 | + |
| 170 | + steps: |
| 171 | + - uses: actions/checkout@v1 |
| 172 | + - name: Set up Python |
| 173 | + uses: actions/setup-python@v1 |
| 174 | + with: |
| 175 | + python-version: "3.7" |
| 176 | + - name: Install dependencies |
| 177 | + run: | |
| 178 | + python -m pip install --upgrade pip |
| 179 | + pip install --upgrade wheel setuptools tox |
| 180 | + - name: Build package |
| 181 | + run: | |
| 182 | + python setup.py sdist bdist_wheel |
| 183 | + - name: Publish package to PyPI |
| 184 | + uses: pypa/gh-action-pypi-publish@master |
| 185 | + with: |
| 186 | + user: __token__ |
| 187 | + password: ${{ secrets.pypi_token }} |
| 188 | + - name: Publish GitHub release notes |
| 189 | + env: |
| 190 | + GH_RELEASE_NOTES_TOKEN: ${{ secrets.release_notes }} |
| 191 | + run: | |
| 192 | + sudo apt-get install pandoc |
| 193 | + tox -e publish-gh-release-notes |
0 commit comments