Pin CI test to Ubuntu 22.04, the last version that supports Python 3.7 #338
Workflow file for this run
This file contains 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: | |
- 'v*' | |
pull_request: | |
branches: | |
- master | |
jobs: | |
Test: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.7" | |
cache: pip | |
cache-dependency-path: '**/setup.cfg' | |
- name: Install | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-dev.in | |
python -m pip install -e . | |
- name: Test with pytest | |
run: pytest -ra --cov . | |
Typecheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install | |
run: python -m pip install -r requirements-typecheck.txt -e . | |
- run: mypy --strict . | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
- uses: pre-commit/[email protected] | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
cache-dependency-path: '**/requirements*.txt' | |
- name: Install | |
run: python -m pip install build | |
- run: python -m build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
Publish: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
needs: | |
- Build | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/p/valohai-utils/ | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
print-hash: true |