|
| 1 | +name: Python codeqa/test |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +jobs: |
| 9 | + lint: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: Set up Python |
| 14 | + uses: actions/setup-python@v2 |
| 15 | + with: |
| 16 | + python-version: 3.x |
| 17 | + - uses: actions/cache@v2 |
| 18 | + with: |
| 19 | + path: ~/.cache/pip |
| 20 | + key: pip-lint |
| 21 | + - name: Install dependencies |
| 22 | + run: pip install flake8 |
| 23 | + - name: Run flake8 |
| 24 | + run: flake8 sphinx_autodoc_typehints.py tests |
| 25 | + |
| 26 | + test: |
| 27 | + needs: [lint] |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + os: [ubuntu-latest] |
| 32 | + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] |
| 33 | + runs-on: ${{ matrix.os }} |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - name: Set up Python ${{ matrix.python-version }} |
| 37 | + uses: actions/setup-python@v2 |
| 38 | + with: |
| 39 | + python-version: ${{ matrix.python-version }} |
| 40 | + - uses: actions/cache@v2 |
| 41 | + with: |
| 42 | + path: ~/.cache/pip |
| 43 | + key: pip-test-${{ matrix.python-version }}-${{ matrix.os }} |
| 44 | + - name: Install dependencies |
| 45 | + run: pip install .[test] coveralls |
| 46 | + - name: Test with pytest |
| 47 | + run: coverage run -m pytest |
| 48 | + - name: Upload Coverage |
| 49 | + run: coveralls --service=github |
| 50 | + env: |
| 51 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + COVERALLS_FLAG_NAME: ${{ matrix.test-name }} |
| 53 | + COVERALLS_PARALLEL: true |
| 54 | + |
| 55 | + coveralls: |
| 56 | + name: Finish Coveralls |
| 57 | + needs: test |
| 58 | + runs-on: ubuntu-latest |
| 59 | + container: python:3-slim |
| 60 | + steps: |
| 61 | + - name: Finished |
| 62 | + run: | |
| 63 | + pip install coveralls |
| 64 | + coveralls --service=github --finish |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments