-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (40 loc) · 1.41 KB
/
test_with_pytest.yml
File metadata and controls
49 lines (40 loc) · 1.41 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
name: Test using pytest
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"] # Test on multiple Python versions
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel
pip install .[test]
- name: Run tests
run: |
source venv/bin/activate
python -m pytest -n=auto --cov=imas --cov-report=term-missing --cov-report=xml:coverage.xml --cov-report=html:htmlcov --junit-xml=junit.xml
- name: Upload coverage report ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
with:
name: coverage-report-${{ matrix.python-version }}
path: htmlcov
- name: Upload test report ${{ matrix.python-version }}
uses: actions/upload-artifact@v4
with:
name: test-report-${{ matrix.python-version }}
path: junit.xml