@@ -27,36 +27,60 @@ concurrency:
2727 cancel-in-progress : ${{ github.event_name == 'pull_request' }}
2828
2929jobs :
30- # * 메인 테스트 + 린트 + 타입체크
31- # abi3-py310 wheel 로 빌드는 한 번이지만 런타임 동작은 버전별 검증 필요 → Linux × 전 버전.
32- # macOS / Windows 는 OS 레이어 스모크이므로 py3.12 하나만.
30+ # * Linux abi3 wheel 1회 빌드 → 모든 Linux 잡(test×4 / slow / core-only)이 공유
31+ # abi3-py310 이라 py3.10/3.11/3.12/3.13 가 동일 wheel 재사용 가능.
32+ # macOS/Windows 는 단일 잡이라 빌드/테스트 분리 이득이 없어 그대로 매번 빌드.
33+ build-linux-wheel :
34+ name : Build Linux abi3 wheel
35+ runs-on : ubuntu-latest
36+ steps :
37+ - uses : actions/checkout@v6
38+ with :
39+ submodules : recursive
40+ - uses : dtolnay/rust-toolchain@stable
41+ - uses : Swatinem/rust-cache@v2
42+ with :
43+ save-if : ${{ github.ref == 'refs/heads/main' }}
44+ - uses : astral-sh/setup-uv@v8.1.0
45+ with :
46+ python-version : " 3.12"
47+ - run : uv sync --no-install-project --group all
48+ - run : uv run maturin build --release --out dist
49+ - uses : actions/upload-artifact@v7
50+ with :
51+ name : rhwp-python-linux-wheel
52+ path : dist/*.whl
53+ retention-days : 1
54+
55+ # * 메인 테스트 + 린트 + 타입체크 (Linux × 전 Python 버전 — wheel 공유)
3356 test :
34- name : Test (${{ matrix.os }} / py${{ matrix.python }})
35- runs-on : ${{ matrix.os }}
57+ name : Test (Linux / py${{ matrix.python }})
58+ needs : build-linux-wheel
59+ runs-on : ubuntu-latest
3660 strategy :
3761 fail-fast : false
3862 matrix :
3963 include :
40- - { os: ubuntu-latest, python: "3.10", lint: true }
41- - { os: ubuntu-latest, python: "3.11" }
42- - { os: ubuntu-latest, python: "3.12" }
43- - { os: ubuntu-latest, python: "3.13" }
44- - { os: macos-latest, python: "3.12" }
45- - { os: windows-latest, python: "3.12" }
64+ - { python: "3.10", lint: true }
65+ - { python: "3.11" }
66+ - { python: "3.12" }
67+ - { python: "3.13" }
4668 defaults :
4769 run :
4870 shell : bash
4971 steps :
5072 - uses : actions/checkout@v6
5173 with :
5274 submodules : recursive
53- - uses : dtolnay/rust-toolchain@stable
54- - uses : Swatinem/rust-cache@v2
5575 - uses : astral-sh/setup-uv@v8.1.0
5676 with :
5777 python-version : ${{ matrix.python }}
5878 - run : uv sync --no-install-project --group all
59- - run : uv run maturin develop --release
79+ - uses : actions/download-artifact@v8
80+ with :
81+ name : rhwp-python-linux-wheel
82+ path : dist/
83+ - run : uv pip install --reinstall dist/*.whl
6084 - name : Run pytest (not slow) with coverage
6185 run : uv run pytest tests/ -m "not slow" --cov=rhwp --cov-report=term-missing -v
6286 - name : Run pyright (normal)
6892 tests/test_langchain_loader.py tests/test_langchain_loader_ir.py \
6993 tests/test_ir_schema.py tests/test_ir_roundtrip.py tests/test_ir_tables.py \
7094 tests/test_ir_iter_blocks.py tests/test_ir_schema_export.py \
95+ tests/test_ir_picture.py tests/test_ir_furniture.py \
96+ tests/test_ir_formula.py tests/test_ir_footnote.py \
97+ tests/test_ir_list.py tests/test_ir_caption.py \
98+ tests/test_ir_toc.py tests/test_ir_field.py \
99+ tests/test_cli.py \
71100 tests/conftest.py tests/type_check_samples.py
72101 - name : Run pyright (intentional errors — expect 4)
73102 if : matrix.lint
@@ -81,9 +110,36 @@ jobs:
81110 exit 1
82111 fi
83112
84- # * PDF 렌더링 — 느려서 별도 잡
113+ # * macOS / Windows 스모크 — 단일 잡이라 wheel 분리 이득 없음 → 직접 maturin develop
114+ test-other-os :
115+ name : Test (${{ matrix.os }} / py3.12)
116+ runs-on : ${{ matrix.os }}
117+ strategy :
118+ fail-fast : false
119+ matrix :
120+ os : [macos-latest, windows-latest]
121+ defaults :
122+ run :
123+ shell : bash
124+ steps :
125+ - uses : actions/checkout@v6
126+ with :
127+ submodules : recursive
128+ - uses : dtolnay/rust-toolchain@stable
129+ - uses : Swatinem/rust-cache@v2
130+ with :
131+ save-if : ${{ github.ref == 'refs/heads/main' }}
132+ - uses : astral-sh/setup-uv@v8.1.0
133+ with :
134+ python-version : " 3.12"
135+ - run : uv sync --no-install-project --group all
136+ - run : uv run maturin develop --release
137+ - run : uv run pytest tests/ -m "not slow" -v
138+
139+ # * PDF 렌더링 — 느려서 별도 잡, Linux wheel 재사용
85140 test-slow :
86141 name : Test slow (Linux / py3.12 — PDF)
142+ needs : build-linux-wheel
87143 runs-on : ubuntu-latest
88144 defaults :
89145 run :
@@ -92,18 +148,21 @@ jobs:
92148 - uses : actions/checkout@v6
93149 with :
94150 submodules : recursive
95- - uses : dtolnay/rust-toolchain@stable
96- - uses : Swatinem/rust-cache@v2
97151 - uses : astral-sh/setup-uv@v8.1.0
98152 with :
99153 python-version : " 3.12"
100154 - run : uv sync --no-install-project --group testing
101- - run : uv run maturin develop --release
155+ - uses : actions/download-artifact@v8
156+ with :
157+ name : rhwp-python-linux-wheel
158+ path : dist/
159+ - run : uv pip install --reinstall dist/*.whl
102160 - run : uv run pytest tests/ -m slow -v
103161
104162 # * extras 미설치 시 langchain 테스트가 importorskip 로 auto-skip 되는지 검증
105163 test-core-only :
106164 name : Test without extras (importorskip auto-skip)
165+ needs : build-linux-wheel
107166 runs-on : ubuntu-latest
108167 defaults :
109168 run :
@@ -112,24 +171,36 @@ jobs:
112171 - uses : actions/checkout@v6
113172 with :
114173 submodules : recursive
115- - uses : dtolnay/rust-toolchain@stable
116- - uses : Swatinem/rust-cache@v2
117174 - uses : astral-sh/setup-uv@v8.1.0
118175 with :
119176 python-version : " 3.12"
120177 - name : Install pytest only (no langchain extras — intentional)
121178 run : |
122179 uv venv
123180 uv pip install pytest
124- - run : uv run maturin develop --release
181+ - uses : actions/download-artifact@v8
182+ with :
183+ name : rhwp-python-linux-wheel
184+ path : dist/
185+ - run : uv pip install dist/*.whl
125186 - name : Run pytest — extras-gated tests must auto-skip via importorskip
126187 # ^ 파일-레벨 importorskip 은 해당 파일 전체를 skip 1개로 카운트.
127- # 현재 gated 파일: test_langchain_loader.py + test_langchain_loader_ir.py
128- # (langchain-core), test_ir_schema_export.py (jsonschema),
129- # test_async.py (aiofiles) → 총 4 파일
188+ # v0.3.0 기준 gated 파일: test_langchain_loader.py + test_langchain_loader_ir.py
189+ # (langchain-core), test_ir_schema_export.py (jsonschema), test_cli.py (typer)
190+ # → 총 4 파일. test_async.py 는 v0.3.0 부터 stdlib 만 사용 (aiofiles 의존성 제거)
130191 run : |
131192 uv run pytest tests/ -m "not slow" -v | tee pytest-output.txt
132193 if ! grep -qE '(^|[^0-9])4 skipped([^0-9]|$)' pytest-output.txt; then
133- echo "::error::expected 4 extras-gated files to auto-skip via importorskip (langchain×2, jsonschema, aiofiles )"
194+ echo "::error::expected 4 extras-gated files to auto-skip via importorskip (langchain×2, jsonschema, typer )"
134195 exit 1
135196 fi
197+
198+ all-tests-passed :
199+ name : All tests passed
200+ if : always()
201+ runs-on : ubuntu-latest
202+ needs : [build-linux-wheel, test, test-other-os, test-slow, test-core-only]
203+ steps :
204+ - uses : re-actors/alls-green@release/v1
205+ with :
206+ jobs : ${{ toJSON(needs) }}
0 commit comments