forked from Lightning-AI/LitServe
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (82 loc) · 2.51 KB
/
ci-testing.yml
File metadata and controls
96 lines (82 loc) · 2.51 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: CI testing
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [main, "release/*"]
pull_request:
branches: [main, "release/*"]
schedule:
- cron: "0 0 * * *" # every day at midnight UTC
defaults:
run:
shell: bash
jobs:
pytester:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Runner images: https://github.com/actions/runner-images
os: ["ubuntu-24.04", "macos-15", "windows-2025"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
include:
- { os: "ubuntu-22.04", python-version: "3.10", requires: "oldest" }
timeout-minutes: 35
env:
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
UV_TORCH_BACKEND: "cpu"
steps:
- uses: actions/checkout@v6
- name: Install uv and setup python
uses: astral-sh/setup-uv@v7
with:
activate-environment: true
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Set up dependencies
run: |
uv pip compile pyproject.toml -o requirements.txt
cat requirements.txt
- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
uv pip install 'lightning-utilities[cli]>=0.15.1'
uv run python -m lightning_utilities.cli requirements set-oldest --req_files=pyproject.toml
- name: Install package
run: |
uv pip list
uv sync --all-extras --dev
uv pip list
- name: Tests
timeout-minutes: 15
run: pytest --cov=litserve tests/ -v -s --durations=100
- name: Statistics
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
- name: Minimize uv cache
run: uv cache prune --ci
tests-guardian:
runs-on: ubuntu-latest
needs: pytester
if: always()
steps:
- run: echo "${{ needs.pytester.result }}"
- name: failing...
if: needs.pytester.result == 'failure'
run: exit 1
- name: cancelled or skipped...
if: contains(fromJSON('["cancelled", "skipped"]'), needs.pytester.result)
timeout-minutes: 1
run: sleep 90