-
Notifications
You must be signed in to change notification settings - Fork 96
105 lines (90 loc) · 3.18 KB
/
ci-testing.yml
File metadata and controls
105 lines (90 loc) · 3.18 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
97
98
99
100
101
102
103
104
105
name: CI Testing
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
jobs:
pytester:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-14", "windows-2022"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
exclude:
- { os: "windows-2022", python-version: "3.13" }
- { os: "windows-2022", python-version: "3.14" }
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 60
env:
UV_TORCH_BACKEND: "cpu"
steps:
# FFmpeg is required for Video Deserializer tests
- name: Setup FFmpeg (shared libs, Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ffmpeg
- name: Setup FFmpeg (shared libs, macOS)
if: runner.os == 'macOS'
run: brew install ffmpeg
- uses: actions/checkout@v6
- name: Install uv and setup python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
with:
activate-environment: true
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install package & dependencies
run: |
uv pip install -U lightning-sdk
uv pip install -e ".[extras]" -r requirements/test.txt -U -q
uv pip list
- name: Run fast tests in parallel
run: |
pytest tests \
--ignore=tests/processing \
--ignore=tests/raw \
-n 2 --cov=litdata --durations=0 --timeout=120 --capture=no --verbose
- name: Run processing tests sequentially
run: |
# note that the listed test should match ignored in the previous step
pytest \
tests/processing tests/raw \
--cov=litdata --cov-append --durations=0 --timeout=120 --capture=no --verbose
- name: Statistics
continue-on-error: true
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests,${{ matrix.os }},${{ matrix.python-version }}
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
- name: Minimize uv cache
run: uv cache prune --ci
testing-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