|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - develop |
| 7 | + - main |
| 8 | + - 'feature/**' |
| 9 | + - 'release/**' |
| 10 | + - 'fix/**' |
| 11 | + |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - develop |
| 15 | + - main |
| 16 | + |
| 17 | + schedule: |
| 18 | + - cron: '0 11 * * *' |
| 19 | + # | | | | | |
| 20 | + # | | | | |____ day of the week (0 - 6 or SUN-SAT) |
| 21 | + # | | | |____ month (1 - 12 or JAN-DEC) |
| 22 | + # | | |____ day of the month (1 - 31) |
| 23 | + # | |____ hour (0 - 23) |
| 24 | + # |____ minute (0 - 59) |
| 25 | + |
| 26 | +env: |
| 27 | + PYTHONUNBUFFERED: '1' |
| 28 | + |
| 29 | +defaults: |
| 30 | + run: |
| 31 | + shell: bash |
| 32 | + |
| 33 | +jobs: |
| 34 | + test: |
| 35 | + name: Python ${{ matrix.python }} on ${{ matrix.os }} |
| 36 | + runs-on: ${{ matrix.os }} |
| 37 | + |
| 38 | + # The maximum number of minutes to let a workflow run |
| 39 | + # before GitHub automatically cancels it. Default: 360 |
| 40 | + timeout-minutes: 30 |
| 41 | + |
| 42 | + strategy: |
| 43 | + # When set to true, GitHub cancels |
| 44 | + # all in-progress jobs if any matrix job fails. |
| 45 | + fail-fast: false |
| 46 | + |
| 47 | + matrix: |
| 48 | + python: |
| 49 | + - '3.5' |
| 50 | + - '3.6' |
| 51 | + - '3.7' |
| 52 | + - '3.8' |
| 53 | + - '3.9' |
| 54 | + - '3.10.0-beta - 3.10' |
| 55 | + - 'pypy-3.7' |
| 56 | + os: [ ubuntu-latest, macos-latest, windows-latest ] |
| 57 | + |
| 58 | + steps: |
| 59 | + - name: Checkout code |
| 60 | + uses: actions/checkout@v2.3.4 |
| 61 | + with: |
| 62 | + fetch-depth: 5 |
| 63 | + |
| 64 | + - name: Set up Python ${{ matrix.python }} |
| 65 | + uses: actions/setup-python@v2.2.2 |
| 66 | + with: |
| 67 | + python-version: ${{ matrix.python }} |
| 68 | + |
| 69 | + - name: Install dependencies |
| 70 | + run: | |
| 71 | + python -m pip install --upgrade pip |
| 72 | + python -m pip install tox tox-gh-actions |
| 73 | +
|
| 74 | + - name: Setuptools self-test |
| 75 | + run: | |
| 76 | + python setup.py --fullname |
| 77 | + python setup.py --long-description |
| 78 | + python setup.py --classifiers |
| 79 | +
|
| 80 | + - name: Run unit tests with coverage |
| 81 | + run: tox |
| 82 | + |
| 83 | + - name: Combine coverage reports |
| 84 | + run: tox -e coverage-report |
| 85 | + |
| 86 | + - name: Upload coverage report |
| 87 | + if: success() |
| 88 | + env: |
| 89 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + COVERALLS_SERVICE_NAME: github |
| 91 | + run: | |
| 92 | + python -m pip install coveralls |
| 93 | + # Do not fail job if coveralls.io is down |
| 94 | + coveralls || true |
| 95 | +
|
| 96 | + - name: Success Reporting |
| 97 | + if: success() |
| 98 | + run: git log --format=fuller -5 |
0 commit comments