ci: Windows 자동 검증 추가 (Gitea Actions + 스모크 스크립트)
Some checks failed
Windows / verify (push) Has been cancelled

개발이 리눅스에서 이뤄지다 보니 Windows 전용 경로는 한 번도 실행해 본 적이
없다. 오디오 캡처, 전역 단축키, 모니터 열거, exe 빌드가 전부 여기 해당하고,
"리눅스에서 다 통과했는데 윈도우에서 안 되더라"가 나올 수 있는 지점이다.

- .gitea/workflows/windows.yml
  push 때마다 Windows 러너에서 테스트 -> 스모크 -> 포터블 exe 빌드 ->
  빌드된 exe 기동 확인까지 하고 exe·스크린샷을 artifact 로 올린다.
  의존성을 packaging/requirements-portable.txt 로 깔아 torch 없는 포터블
  조건을 그대로 재현하고, torch 가 섞이면 바로 실패하게 했다.

- packaging/windows_smoke.py
  리눅스에서 확인 불가능한 항목만 모은 점검기. WASAPI 장치 열거, 소리 내는
  프로그램 열거, 전역 단축키 등록/해제, 실제 모니터 열거, GPU 인식,
  사용 가능 티어, 자막 오버레이 실제 렌더링(스크린샷 저장).
  한 항목이 실패해도 나머지를 계속 돌려 전체 그림을 한 번에 보여준다.
  러너 환경에 따라 없을 수 있는 항목(오디오 장치·보조 exe·GPU)은 경고로만
  두고, 코드 문제인 항목만 빌드를 실패시킨다.

- docs/WINDOWS-TESTING.md
  러너 등록 절차와, 러너 없이 직접 돌려보는 방법.

러너가 없으면 워크플로는 대기만 하므로 지금 상태에 영향이 없다.

검증: pytest 189개 통과, ruff clean, 워크플로 YAML 파싱 확인,
      스모크 스크립트를 리눅스에서 실행해 항목별 판정과 종료코드 확인

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-09-23 03:11:31 +09:00
parent bede94ee48
commit 2fcd961f8f
5 changed files with 429 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
# Windows 검증 — Gitea Actions
#
# 이 저장소에 push 하면 Windows 러너가 자동으로
# 1) 테스트를 돌리고
# 2) 포터블 exe 를 빌드하고
# 3) 앱이 실제로 뜨는지 확인한 뒤
# 4) exe 와 스크린샷을 artifact 로 올립니다.
#
# 러너 등록 방법은 docs/WINDOWS-TESTING.md 참고.
# 러너가 없으면 이 워크플로는 그냥 대기 상태로 남고 아무 일도 하지 않습니다.
name: Windows
on:
push:
branches: [main]
workflow_dispatch:
jobs:
verify:
runs-on: windows
timeout-minutes: 60
steps:
- name: 소스 받기
uses: actions/checkout@v4
- name: Python 준비
shell: pwsh
run: |
python --version
python -m venv .venv-ci
.\.venv-ci\Scripts\python -m pip install --upgrade pip --quiet
# torch 없이 설치한다. 포터블 빌드와 같은 조건을 만들어야
# "포터블에서 1~3티어가 된다"는 주장을 실제로 검증할 수 있다.
- name: 의존성 설치 (포터블 조건 = torch 없음)
shell: pwsh
run: |
.\.venv-ci\Scripts\python -m pip install -r packaging\requirements-portable.txt
.\.venv-ci\Scripts\python -m pip install pytest ruff
.\.venv-ci\Scripts\python -c "import importlib.util; assert importlib.util.find_spec('torch') is None; print('torch 없음 - 포터블 조건 OK')"
- name: 테스트
shell: pwsh
env:
PYTHONPATH: src
run: |
.\.venv-ci\Scripts\python -m pytest tests -q
.\.venv-ci\Scripts\python -m ruff check src tests scripts
# 여기부터가 리눅스에서 못 하던 것들이다.
- name: Windows 전용 경로 확인 (오디오 장치·단축키·프로세스 열거)
shell: pwsh
env:
PYTHONPATH: src
run: .\.venv-ci\Scripts\python packaging\windows_smoke.py
- name: 프로그램별 캡처 보조 프로그램 빌드
shell: pwsh
continue-on-error: true # VS Build Tools 가 없는 러너도 있을 수 있다
run: |
cmake -S native\process_loopback -B native\process_loopback\build -A x64
cmake --build native\process_loopback\build --config Release
- name: 포터블 exe 빌드
shell: pwsh
run: |
.\.venv-ci\Scripts\python -m pip install pyinstaller
.\.venv-ci\Scripts\python -m PyInstaller packaging\livesub.spec --noconfirm
$exe = Get-Item dist\LiveSub.exe
"빌드 완료: {0:N1} MB" -f ($exe.Length / 1MB)
- name: 빌드된 exe 가 실제로 실행되는지
shell: pwsh
run: .\.venv-ci\Scripts\python packaging\windows_smoke.py --exe dist\LiveSub.exe
- name: 결과물 업로드
uses: actions/upload-artifact@v4
if: always()
with:
name: LiveSub-portable
path: |
dist/LiveSub.exe
artifacts/*.png
artifacts/*.txt
retention-days: 14