graphene/.github/workflows/tests.yml

84 lines
2.1 KiB
YAML
Raw Normal View History

2021-08-19 09:33:27 +03:00
name: 📄 Tests
on:
push:
branches:
- master
- '*.x'
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
pull_request:
branches:
- master
- '*.x'
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
jobs:
tests:
# runs the test suite
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
2021-08-19 12:30:09 +03:00
- name: cache pip dependencies
2021-08-19 09:33:27 +03:00
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}
- run: pip install tox
- run: tox -e ${{ matrix.tox }}
2021-08-19 12:30:09 +03:00
coveralls_finish:
2021-08-19 09:33:27 +03:00
# check coverage increase/decrease
needs: tests
2021-08-19 12:30:09 +03:00
runs-on: ubuntu-latest
2021-08-19 09:33:27 +03:00
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
deploy:
# builds and publishes to PyPi
2021-08-19 12:30:09 +03:00
runs-on: ubuntu-latest
2021-08-19 09:33:27 +03:00
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
2021-08-19 12:30:09 +03:00
python-version: '3.7'
2021-08-19 09:33:27 +03:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}