|
| 1 | +name: build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + tox_env: |
| 14 | + - "py35-pytestlatest" |
| 15 | + - "py36-pytestlatest" |
| 16 | + - "py37-pytestlatest" |
| 17 | + - "py38-pytestlatest" |
| 18 | + - "py39-pytestlatest" |
| 19 | + - "py38-pytestmaster" |
| 20 | + - "py38-psutil" |
| 21 | + - "linting" |
| 22 | + |
| 23 | + os: [ubuntu-latest, windows-latest] |
| 24 | + include: |
| 25 | + - tox_env: "py35-pytestlatest" |
| 26 | + python: "3.5" |
| 27 | + - tox_env: "py36-pytestlatest" |
| 28 | + python: "3.6" |
| 29 | + - tox_env: "py37-pytestlatest" |
| 30 | + python: "3.7" |
| 31 | + - tox_env: "py38-pytestlatest" |
| 32 | + python: "3.8" |
| 33 | + - tox_env: "py39-pytestlatest" |
| 34 | + python: "3.9" |
| 35 | + - tox_env: "py38-pytestmaster" |
| 36 | + python: "3.8" |
| 37 | + - tox_env: "py38-psutil" |
| 38 | + python: "3.8" |
| 39 | + - tox_env: "linting" |
| 40 | + python: "3.8" |
| 41 | + |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@v1 |
| 44 | + - name: Set up Python |
| 45 | + uses: actions/setup-python@v1 |
| 46 | + with: |
| 47 | + python-version: ${{ matrix.python }} |
| 48 | + - name: Install tox |
| 49 | + run: | |
| 50 | + python -m pip install --upgrade pip |
| 51 | + pip install tox |
| 52 | + - name: Test |
| 53 | + run: | |
| 54 | + tox -e ${{ matrix.tox_env }} |
| 55 | +
|
| 56 | + linting: |
| 57 | + |
| 58 | + runs-on: ubuntu-latest |
| 59 | + |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v1 |
| 62 | + - name: Set up Python |
| 63 | + uses: actions/setup-python@v1 |
| 64 | + with: |
| 65 | + python-version: "3.7" |
| 66 | + - name: Install tox |
| 67 | + run: | |
| 68 | + python -m pip install --upgrade pip |
| 69 | + pip install tox |
| 70 | + - name: Linting |
| 71 | + run: | |
| 72 | + tox -e linting |
| 73 | +
|
| 74 | + deploy: |
| 75 | + |
| 76 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 77 | + |
| 78 | + runs-on: ubuntu-latest |
| 79 | + |
| 80 | + needs: [build, linting] |
| 81 | + |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v1 |
| 84 | + - name: Set up Python |
| 85 | + uses: actions/setup-python@v1 |
| 86 | + with: |
| 87 | + python-version: "3.7" |
| 88 | + - name: Install wheel |
| 89 | + run: | |
| 90 | + python -m pip install --upgrade pip |
| 91 | + pip install wheel |
| 92 | + - name: Build package |
| 93 | + run: | |
| 94 | + python setup.py sdist bdist_wheel |
| 95 | + - name: Publish package to PyPI |
| 96 | + uses: pypa/gh-action-pypi-publish@master |
| 97 | + with: |
| 98 | + user: __token__ |
| 99 | + password: ${{ secrets.pypi_token }} |
0 commit comments