|
| 1 | +name: CI |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - release/** |
| 7 | + workflow_dispatch: {} |
| 8 | + |
| 9 | +jobs: |
| 10 | + linters: |
| 11 | + name: Linting and static analysis |
| 12 | + runs-on: ubuntu-20.04 |
| 13 | + timeout-minutes: 5 |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - uses: actions/setup-python@v2 |
| 17 | + with: |
| 18 | + python-version: "3.10" |
| 19 | + - run: pip install -r requirements.txt |
| 20 | + - run: pre-commit run --all-files |
| 21 | + - run: mypy pytest_instant --strict |
| 22 | + |
| 23 | + unit-tests: |
| 24 | + strategy: |
| 25 | + fail-fast: false |
| 26 | + matrix: |
| 27 | + python-version: [ "3.7", "3.8", "3.9", "3.10" ] |
| 28 | + name: Python ${{ matrix.python-version }} |
| 29 | + runs-on: ubuntu-20.04 |
| 30 | + timeout-minutes: 5 |
| 31 | + steps: |
| 32 | + - uses: actions/checkout@v2 |
| 33 | + - uses: actions/setup-python@v2 |
| 34 | + with: |
| 35 | + python-version: ${{ matrix.python-version }} |
| 36 | + |
| 37 | + - run: pip install -r requirements.txt |
| 38 | + - run: pip install -e . |
| 39 | + - run: pytest --color=yes --cov=pytest_instant --cov-branch |
| 40 | + |
| 41 | + - name: Publish coverage to Coveralls.io |
| 42 | + if: success() |
| 43 | + run: coveralls --service=github |
| 44 | + env: |
| 45 | + GITHUB_TOKEN: ${{ secrets.github_token }} |
| 46 | + continue-on-error: true |
| 47 | + - name: Publish coverage to CodeCov.io |
| 48 | + uses: codecov/codecov-action@v1 |
| 49 | + if: success() |
| 50 | + env: |
| 51 | + PYTHON: ${{ matrix.python-version }} |
| 52 | + with: |
| 53 | + flags: unit |
| 54 | + env_vars: PYTHON |
| 55 | + continue-on-error: true |
| 56 | + |
| 57 | + # No coverage: PyPy performs extremely poorly with tracing/coverage. |
| 58 | + pypy-tests: |
| 59 | + strategy: |
| 60 | + fail-fast: false |
| 61 | + matrix: |
| 62 | + python-version: [ "pypy-3.7", "pypy-3.8" ] |
| 63 | + name: Python ${{ matrix.python-version }} |
| 64 | + runs-on: ubuntu-20.04 |
| 65 | + timeout-minutes: 5 |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v2 |
| 68 | + - uses: actions/setup-python@v2 |
| 69 | + with: |
| 70 | + python-version: ${{ matrix.python-version }} |
| 71 | + |
| 72 | + - run: pip install -r requirements.txt |
| 73 | + - run: pip install -e . |
| 74 | + - run: pytest --color=yes --no-cov |
| 75 | + |
| 76 | + coveralls-finish: |
| 77 | + name: Finalize coveralls.io |
| 78 | + needs: [unit-tests] |
| 79 | + runs-on: ubuntu-20.04 |
| 80 | + steps: |
| 81 | + - uses: actions/setup-python@v2 |
| 82 | + - run: pip install coveralls |
| 83 | + - run: coveralls --service=github --finish |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.github_token }} |
| 86 | + continue-on-error: true |
0 commit comments