[CI] Merged pypi.yaml into release.yaml #25
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 - Python Tests Across Multiple Environments | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
[ | |
".github/workflows/ci.yaml", | |
"pyproject.toml", | |
"poetry.lock", | |
"tests/**", | |
"streamsnapper/**", | |
] | |
pull_request: | |
paths: | |
[ | |
".github/workflows/ci.yaml", | |
"pyproject.toml", | |
"poetry.lock", | |
"tests/**", | |
"streamsnapper/**", | |
] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: 🐍 Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
if: startsWith(github.event.head_commit.message, 'Bump version to') || startsWith(github.event.head_commit.message, '[CI]') | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-22.04"] | |
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
steps: | |
- name: 📥 Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: 🐍 Setup Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
check-latest: true | |
- name: 📦 Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: latest | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
- name: 💾 Cache Poetry Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: .venv | |
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
restore-keys: | | |
poetry-${{ runner.os }}- | |
- name: 📚 Install Dependencies | |
run: poetry install --extras "all" --no-interaction | |
- name: 🧪 Run Tests | |
run: poetry run pytest tests/all.py -v --color=yes |