# 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: # Gitea 는 runs-on 이 어떤 러너 라벨과도 안 맞으면 작업을 실패시키지 않고 # 기본 ubuntu 컨테이너에서 돌린다. 라벨을 잘못 등록하면 Windows 검증이 # 조용히 리눅스에서 돌아가 "통과했다"는 착각을 준다. 그래서 먼저 막는다. - name: Windows 에서 돌고 있는지 확인 shell: bash run: | echo "RUNNER_OS=$RUNNER_OS" if [ "$RUNNER_OS" != "Windows" ]; then echo "::error::Windows 러너가 아닙니다 ($RUNNER_OS)." echo "::error::러너를 'windows:host' 라벨로 등록했는지 확인하세요." exit 1 fi - 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