|
| 1 | +name: CI |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events |
| 6 | + push: |
| 7 | + pull_request: |
| 8 | + schedule: |
| 9 | + - cron: '0 12 * * 0' # run once a week on Sunday |
| 10 | + |
| 11 | + # Allows you to run this workflow manually from the Actions tab |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 15 | +jobs: |
| 16 | + tests: |
| 17 | + name: "Python ${{ matrix.python-version }}" |
| 18 | + runs-on: "ubuntu-latest" |
| 19 | + |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + python-version: ["3.6", "3.7", "3.8", "3.9"] |
| 23 | + |
| 24 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 25 | + steps: |
| 26 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 27 | + - uses: "actions/checkout@v2" |
| 28 | + - uses: "actions/setup-python@v2" |
| 29 | + with: |
| 30 | + python-version: "${{ matrix.python-version }}" |
| 31 | + - name: "Install dependencies" |
| 32 | + run: | |
| 33 | + set -xe |
| 34 | + python -VV |
| 35 | + python -m site |
| 36 | + python -m pip install --upgrade pip setuptools wheel |
| 37 | + python -m pip install --upgrade virtualenv tox tox-gh-actions |
| 38 | + - name: "Run tox targets for ${{ matrix.python-version }}" |
| 39 | + run: "python -m tox" |
| 40 | + |
| 41 | + - name: "Report to coveralls" |
| 42 | + # coverage is only created in the py39 environment |
| 43 | + # --service=github is a workaround for bug |
| 44 | + # https://github.com/coveralls-clients/coveralls-python/issues/251 |
| 45 | + if: "matrix.python-version == '3.9'" |
| 46 | + run: | |
| 47 | + pip install coveralls |
| 48 | + coveralls --service=github |
| 49 | + env: |
| 50 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments