forked from curt-tigges/crosslayer-coding
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.34 KB
/
python-tests.yml
File metadata and controls
45 lines (38 loc) · 1.34 KB
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
name: Python Tests
on:
push:
branches:
- main
- develop # Or your primary development branch
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"] # Specify python versions
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
# Alternatively, if not using Poetry, or have a requirements.txt:
# run: pip install -r requirements.txt
- name: Install dependencies
run: poetry install --no-interaction --no-root
# If you have dev dependencies for pytest, e.g. in a [tool.poetry.group.dev.dependencies]
# run: poetry install --no-interaction --no-root --with dev
# Or if using pip with requirements.txt:
# run: pip install -r requirements-dev.txt # (if you have a separate dev requirements)
# run: pip install pytest # or ensure pytest is in your main requirements
- name: Run tests with pytest
run: poetry run pytest tests/
# Or if not using poetry:
# run: pytest tests/