-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (64 loc) · 1.89 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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