|
| 1 | +name: 📄 Tests |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - master |
| 6 | + - '*.x' |
| 7 | + paths-ignore: |
| 8 | + - 'docs/**' |
| 9 | + - '*.md' |
| 10 | + - '*.rst' |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + - '*.x' |
| 15 | + paths-ignore: |
| 16 | + - 'docs/**' |
| 17 | + - '*.md' |
| 18 | + - '*.rst' |
| 19 | +jobs: |
| 20 | + tests: |
| 21 | + # runs the test suite |
| 22 | + name: ${{ matrix.name }} |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + include: |
| 28 | + - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} |
| 29 | + - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} |
| 30 | + - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.python }} |
| 36 | + |
| 37 | + - name: update pip |
| 38 | + run: | |
| 39 | + pip install -U wheel |
| 40 | + pip install -U setuptools |
| 41 | + python -m pip install -U pip |
| 42 | +
|
| 43 | + - name: get pip cache dir |
| 44 | + id: pip-cache |
| 45 | + run: echo "::set-output name=dir::$(pip cache dir)" |
| 46 | + |
| 47 | + - name: cache pip |
| 48 | + uses: actions/cache@v2 |
| 49 | + with: |
| 50 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 51 | + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }} |
| 52 | + |
| 53 | + - run: pip install tox |
| 54 | + - run: tox -e ${{ matrix.tox }} |
| 55 | + |
| 56 | + coveralls: |
| 57 | + # check coverage increase/decrease |
| 58 | + needs: tests |
| 59 | + runs-on: ${{ matrix.os }} |
| 60 | + steps: |
| 61 | + - name: Coveralls Finished |
| 62 | + uses: AndreMiras/coveralls-python-action@develop |
| 63 | + with: |
| 64 | + parallel-finished: true |
| 65 | + |
| 66 | + deploy: |
| 67 | + # builds and publishes to PyPi |
| 68 | + runs-on: ${{ matrix.os }} |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v2 |
| 71 | + - name: Set up Python |
| 72 | + uses: actions/setup-python@v2 |
| 73 | + with: |
| 74 | + python-version: '3.7' |
| 75 | + - name: Install dependencies |
| 76 | + run: | |
| 77 | + python -m pip install --upgrade pip |
| 78 | + pip install build |
| 79 | + - name: Build package |
| 80 | + run: python -m build |
| 81 | + - name: Publish package |
| 82 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 83 | + with: |
| 84 | + user: __token__ |
| 85 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments