-
-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (48 loc) · 1.28 KB
/
test.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
name: Test
on:
workflow_call:
inputs:
python-version:
required: true
type: string
coverage:
required: false
type: boolean
default: false
os:
required: false
type: string
default: "ubuntu-latest"
timeout:
required: false
type: number
default: 60
jobs:
test:
runs-on: ${{ inputs.os }}
timeout-minutes: ${{ inputs.timeout }}
defaults:
run:
shell: bash
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install ${{ inputs.python-version }}
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$PWD" >> $GITHUB_ENV
- name: Test
if: ${{ !inputs.coverage }}
run: uv run pytest --dist "loadgroup" -m "" -n 2
- name: Test with coverage
if: ${{ inputs.coverage }}
run: uv run pytest --dist "loadgroup" -m "" --cov=litestar_vite --cov-report=xml -n 2
- uses: actions/upload-artifact@v4
if: ${{ inputs.coverage }}
with:
name: coverage-xml
path: coverage.xml