-
-
Notifications
You must be signed in to change notification settings - Fork 15
194 lines (186 loc) · 7.27 KB
/
ci-full.yml
File metadata and controls
194 lines (186 loc) · 7.27 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: CI Full
# Tier 2 — master push 직후에만 도는 통합 회귀 게이트 (목표 ≤ 10분).
# PR 단계에서는 돌지 않음 (ci-fast 만). master merge 후 regression 검증 책임.
# realdata-suite path-filter matrix 는 본 파일에서만 실행 (PR 에서 제거).
on:
push:
branches: [master]
workflow_dispatch: {}
workflow_call: {}
concurrency:
group: ci-full-${{ github.ref }}
cancel-in-progress: true
jobs:
# 전체 Python 3.12 / 3.13 matrix + integration + requires_data (fixture 기반).
# 이전 ci.yml 의 `test` job 과 동등.
test-full:
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-cov hypothesis pytest-benchmark pytest-xdist
pip install -e .[all]
# realData/heavy/freshInstall 제외 — 이들은 realdata-suite / ci-nightly 담당.
- name: Run tests with coverage (Python 3.12)
if: matrix.python-version == '3.12'
env:
DARTLAB_DATA_DIR: ${{ github.workspace }}/tests/fixtures
PYTEST_MEMORY_LIMIT_MB: "1900"
DARTLAB_TEST_LOCKED: "1"
run: |
pytest tests/ -n 2 --dist loadfile --tb=short \
-m "not requires_data and not heavy and not realData and not freshInstall" \
--ignore=tests/test_fixture_analysis_real.py \
--ignore=tests/test_fixture_credit_real.py \
--ignore=tests/test_fixture_story_real.py \
--ignore=tests/realData \
--cov=dartlab --cov-report=term-missing --cov-report=html --cov-report=xml \
--cov-fail-under=40 --benchmark-disable
- name: Run tests without coverage (Python 3.13)
if: matrix.python-version == '3.13'
env:
DARTLAB_DATA_DIR: ${{ github.workspace }}/tests/fixtures
PYTEST_MEMORY_LIMIT_MB: "1900"
DARTLAB_TEST_LOCKED: "1"
run: |
pytest tests/ -n 2 --dist loadfile --tb=short \
-m "not requires_data and not heavy and not realData and not freshInstall" \
--ignore=tests/test_fixture_analysis_real.py \
--ignore=tests/test_fixture_credit_real.py \
--ignore=tests/test_fixture_story_real.py \
--ignore=tests/realData \
--no-cov --benchmark-disable
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage report
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v5
with:
name: coverage-report
path: htmlcov/
# Fixture 기반 integration 테스트 — 큰 메모리 필요한 파일 격리 실행.
fixture-integration:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio hypothesis pytest-benchmark
pip install -e .[all]
- name: Run fixture integration tests (high memory, sequential)
env:
DARTLAB_DATA_DIR: ${{ github.workspace }}/tests/fixtures
PYTEST_MEMORY_LIMIT_MB: "5000"
DARTLAB_TEST_LOCKED: "1"
run: |
for f in tests/test_fixture_analysis_real.py tests/test_fixture_credit_real.py tests/test_fixture_story_real.py; do
echo "=== $f ==="
pytest "$f" --tb=short -q --benchmark-disable -p no:cacheprovider || exit 1
done
# Cross-OS smoke — Windows/macOS 경로·인코딩·라인엔딩 회귀.
# PR 에서는 제거 (ubuntu 만으로도 대부분 커버), master 에서만 3 OS 검증.
cross-os-smoke:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install minimal deps
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio hypothesis build pytest-cov pytest-benchmark
pip install -e .
# shell: bash — Windows 에서 기본 PowerShell 은 backslash 연속 미지원.
# 단일 라인으로 써도 되지만 가독성 위해 bash 명시. Linux/macOS 도 bash 기본.
- name: Run unit + bundle tests
env:
PYTHONIOENCODING: utf-8
DARTLAB_TEST_LOCKED: "1"
shell: bash
run: python -X utf8 -m pytest tests/test_bundledResources.py tests/test_wheelPackaging.py -m "unit and not heavy" --tb=short --no-cov --benchmark-disable
- name: Silent-fail lint
shell: bash
run: python -X utf8 scripts/dev/checkSilentFail.py
# realData 스위트 path-filter matrix — master push 에만 실행.
# PR 에서는 돌지 않음 (ci-fast 책임은 smoke + unit 까지).
realdata-plan:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.plan.outputs.tests }}
hasAny: ${{ steps.plan.outputs.hasAny }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Plan realData tests by path diff
id: plan
env:
GITHUB_BASE_REF: ${{ github.event.pull_request.base.ref || '' }}
run: |
python -X utf8 .github/scripts/planRealdata.py > /tmp/tests.json
echo "plan 결과:"
cat /tmp/tests.json
echo
COUNT=$(python -c "import json; print(len(json.load(open('/tmp/tests.json'))))")
echo "tests=$(cat /tmp/tests.json)" >> $GITHUB_OUTPUT
if [ "$COUNT" -gt 0 ]; then
echo "hasAny=true" >> $GITHUB_OUTPUT
else
echo "hasAny=false" >> $GITHUB_OUTPUT
fi
realdata-suite:
needs: realdata-plan
if: ${{ needs.realdata-plan.outputs.hasAny == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
test_file: ${{ fromJson(needs.realdata-plan.outputs.tests) }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-asyncio pytest-rerunfailures hypothesis
pip install -e .[all]
- name: Run ${{ matrix.test_file }}
env:
DARTLAB_DATA_DIR: ${{ github.workspace }}/tests/fixtures
PYTEST_MEMORY_LIMIT_MB: "6000"
DARTLAB_TEST_LOCKED: "1"
run: |
bash scripts/dev/test-realdata.sh tests/realData/${{ matrix.test_file }} -v --tb=short