-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.76 KB
/
testing-and-coverage.yml
File metadata and controls
59 lines (53 loc) · 1.76 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# This workflow will install Python dependencies, run tests and report code coverage with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit test and code coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install -e .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run unit tests with pytest
run: |
python -m pytest --cov=jump_starter --cov-report=xml
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-lowest-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade uv
uv venv venv
source venv/bin/activate
uv pip compile --resolution=lowest-direct -o requirements_lowest.txt pyproject.toml
uv pip install --constraint=requirements_lowest.txt -e .[dev]
- name: Run unit tests with pytest
run: |
source venv/bin/activate
python -m pytest