Update to ubunto-latest #3
Workflow file for this run
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: ["**"] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.6, 3.7, 3.8] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools | |
| pip install "importlib-metadata==4.8.3" | |
| pip install -r requirements.txt -e .[test] | |
| - name: Show Python and pytest versions | |
| run: | | |
| python --version | |
| pytest --version | |
| - name: Run pre-commit checks | |
| run: pre-commit run --all-files | |
| - name: Run tests with coverage | |
| run: pytest --cov --cov-config=.coveragerc | |
| - name: Upload coverage to GitHub (optional, internal) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: .coverage | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.8 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.8 | |
| - name: Upgrade pip and setuptools | |
| run: | | |
| python -m pip install --upgrade pip setuptools | |
| - name: Install dependencies | |
| run: pip install twine wheel | |
| - name: Setup deployment | |
| run: python setup.py sdist bdist_wheel | |
| - name: Validate deployment | |
| run: twine check dist/* | |
| - name: Run deployment | |
| run: | |
| twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} |