-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (49 loc) · 1.65 KB
/
ci.yml
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
name: CI
on:
pull_request:
push:
branches: [main]
workflow_dispatch: # allows you to trigger the workflow run manually
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
python-version: [ "3.10", "3.11", "3.12" ]
resolution: [ "highest", "lowest-direct" ]
steps:
- uses: actions/checkout@v4
- name: Set up uv and caching
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-suffix: "${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.resolution }}"
cache-dependency-glob: "setup.cfg"
version: "0.4.9"
- name: Create venv
run: |
uv venv --seed --python ${{ matrix.python-version }}
- name: Install ${{ matrix.resolution }} dependencies
run: |
uv pip install --resolution ${{ matrix.resolution }} .[test]
- name: Test with pytest (linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
source .venv/bin/activate
pytest --xdoc --cov=primap2 --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Test with pytest (windows)
if: startsWith(matrix.os, 'windows')
run: |
.venv\Scripts\activate
pytest --xdoc --cov=primap2 --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}