chore: 更新 engine submodule 到 c4e55c6(TRT CUDA Stream 异步) #132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [dev, master, feature/*] | |
| pull_request: | |
| branches: [dev, master] | |
| jobs: | |
| test: | |
| if: github.ref_name != 'master' # master is the release branch (no tests/) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # 引擎子模块 third_party/video_ocr_engine | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: pip install -e . | |
| - name: Install test runner | |
| run: pip install pytest | |
| - name: Run unit tests | |
| run: python -m pytest tests/ -v | |
| env: | |
| PYTHONIOENCODING: utf-8 # 中文 skip reason 在 GBK 控制台崩溃(曾致 decoder-smoke 误红) | |
| decoder-smoke: | |
| # 解码集成测试:下载自建 decord fork(chr431/decord release)真实运行 | |
| # CPU 软解冒烟(无需 GPU)。下载失败或 fork 缺失时测试显式跳过并报告, | |
| # 不让整个 CI 变红 —— 但测试本身失败(解码行为变化)会红。 | |
| if: github.ref_name != 'master' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # 引擎子模块 third_party/video_ocr_engine | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install -e . | |
| pip install pytest | |
| - name: Download decord fork release (v0.7.11) | |
| continue-on-error: true # 网络失败 → 后续步骤显式跳过并报告 | |
| shell: pwsh | |
| run: | | |
| $ProgressPreference = 'SilentlyContinue' | |
| Invoke-WebRequest -Uri "https://github.com/chr431/decord/releases/download/v0.7.11/decord-0.7.11-win64-gpu.zip" -OutFile "$env:RUNNER_TEMP\decord.zip" | |
| # zip 顶层即 _decord_build/ 目录 —— 解压到工作区根,避免 _decord_build/_decord_build 嵌套 | |
| Expand-Archive "$env:RUNNER_TEMP\decord.zip" -DestinationPath "." -Force | |
| - name: "Install decord into site-packages (fork: DLLs + python layer)" | |
| if: hashFiles('_decord_build/python/decord/video_reader.py') != '' | |
| shell: pwsh | |
| run: | | |
| $sp = python -c "import site; print(site.getsitepackages()[0])" | |
| New-Item -ItemType Directory -Force -Path "$sp\decord" | Out-Null | |
| Copy-Item "_decord_build\*.dll" "$sp\decord\" -Force | |
| Copy-Item "_decord_build\ffprobe.exe" "$sp\decord\" -Force -ErrorAction SilentlyContinue | |
| Copy-Item "_decord_build\python\decord\*" "$sp\decord\" -Recurse -Force | |
| python -c "import decord; print('decord fork installed:', decord.__file__)" | |
| - name: Report decoder availability (explicit skip reason when absent) | |
| shell: pwsh | |
| run: | | |
| python -c "import decord, inspect, decord.video_reader as v" 2>$null | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "::warning::decord 未安装(下载失败或 release 不可用)—— 解码集成测试将显式跳过" | |
| } | |
| # 仅报告不判红:runner 的 pwsh 包装会以 $LASTEXITCODE 收尾,必须显式归零 | |
| exit 0 | |
| - name: Decoder integration tests | |
| # decord 未装时跳过整个步骤:pytest 对"模块级 importorskip 全跳过 | |
| # (collected 0 items)"返回非零退出码(pytest 9),会误红 | |
| if: hashFiles('_decord_build/python/decord/video_reader.py') != '' | |
| run: python -m pytest tests/test_decoder_integration.py -v -rs | |
| env: | |
| PYTHONIOENCODING: utf-8 # 中文 skip reason 在 GBK 控制台崩溃 | |
| version-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Verify all version references | |
| run: python tools/version.py |