CI #570
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '30 7 * * *' | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| max-parallel: 4 | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install tox | |
| - name: Test with tox | |
| run: | | |
| tox -e py$(echo ${{ matrix.python-version }} | tr -d .)-tests | |
| - name: Test cli | |
| run: | | |
| tox -e py$(echo ${{ matrix.python-version }} | tr -d .)-cli | |
| - name: Check style | |
| if: ${{ matrix.python-version == 3.8 }} | |
| run: | | |
| tox -e py$(echo ${{ matrix.python-version }} | tr -d .)-lint | |
| tox -e copying | |
| - name: Upload coverage to Codecov | |
| if: ${{ (matrix.python-version == 3.8 || matrix.python-version == 2.7) }} | |
| uses: codecov/codecov-action@v1 | |
| with: | |
| fail_ci_if_error: true | |
| - name: Build a source tarball | |
| if: matrix.python-version == 3.8 | |
| run: python setup.py sdist check --strict --metadata | |
| - name: Publish package to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@master | |
| if: >- | |
| matrix.python-version == 3.8 && | |
| github.event_name == 'push' && | |
| startsWith(github.event.ref, 'refs/tags') | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.test_pypi_password }} | |
| repository_url: https://test.pypi.org/legacy/ | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@master | |
| if: >- | |
| matrix.python-version == 3.8 && | |
| github.event_name == 'push' && | |
| startsWith(github.event.ref, 'refs/tags') | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_password }} |