|
| 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.10', python: '3.10', os: ubuntu-latest, tox: py310} |
| 29 | + - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} |
| 30 | + - { name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38 } |
| 31 | + - { name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37 } |
| 32 | + - { name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36 } |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + - uses: actions/setup-python@v3 |
| 36 | + with: |
| 37 | + python-version: ${{ matrix.python }} |
| 38 | + |
| 39 | + - name: update pip |
| 40 | + run: | |
| 41 | + pip install -U wheel |
| 42 | + pip install -U setuptools |
| 43 | + python -m pip install -U pip |
| 44 | +
|
| 45 | + - name: get pip cache dir |
| 46 | + id: pip-cache |
| 47 | + run: echo "::set-output name=dir::$(pip cache dir)" |
| 48 | + |
| 49 | + - name: cache pip dependencies |
| 50 | + uses: actions/cache@v3 |
| 51 | + with: |
| 52 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 53 | + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }} |
| 54 | + |
| 55 | + - run: pip install tox |
| 56 | + - run: tox -e ${{ matrix.tox }} |
| 57 | + - name: Upload coverage.xml |
| 58 | + if: ${{ matrix.python == '3.10' }} |
| 59 | + uses: actions/upload-artifact@v3 |
| 60 | + with: |
| 61 | + name: graphene-sqlalchemy-coverage |
| 62 | + path: coverage.xml |
| 63 | + if-no-files-found: error |
| 64 | + - name: Upload coverage.xml to codecov |
| 65 | + if: ${{ matrix.python == '3.10' }} |
| 66 | + uses: codecov/codecov-action@v3 |
0 commit comments