update test requirements for py 36 37 #31
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: Python package | |
| on: | |
| push: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-legacy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.5", "3.6", "3.7"] | |
| # Use Docker container to run legacy Python versions | |
| container: | |
| image: python:${{ matrix.python-version }}-buster | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r test-requirements.txt | |
| - name: Test with pytest | |
| run: | | |
| pytest --cov=./ --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-modern: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install -r test-requirements.txt | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
| - name: Test with pytest | |
| run: | | |
| pytest --cov=./ --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| env_vars: OS,PYTHON | |
| fail_ci_if_error: true | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: codecov-umbrella | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| verbose: true | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: [test-legacy, test-modern] | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
| - name: Build package | |
| run: python -m build | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| skip-existing: true | |
| env: | |
| PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" |