ci: download_testを再びCIとして動かす (#1301)
#979
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: Download test workflow | |
| on: | |
| workflow_call: | |
| inputs: | |
| version: | |
| description: "テスト対象のコアのバージョン。無指定時はprerelease込みの最新release。" | |
| type: string | |
| required: false | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| paths: | |
| - "Cargo.*" | |
| - "crates/downloader/**" | |
| - rust-toolchain | |
| - ".cargo/config.toml" # 今のところは未使用ではあるが、Rustを利用するワークフローとして統一しておく。 | |
| - ".github/actions/rust-toolchain-from-file/**" | |
| - ".github/workflows/download_test.yml" | |
| env: | |
| VERSION: ${{ inputs.version || 'prerelease-latest' }} | |
| defaults: | |
| run: | |
| shell: bash | |
| # TODO: テスト内容がv0.14当時の考え方を引きずっているので、今のダウンローダーに合うように再考する。 | |
| jobs: | |
| download-releases: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: 通常ダウンロード | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- # バージョン指定のために -- が必要 | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| models/README.txt | |
| dict/open_jtalk_dic_utf_8-1.11 | |
| c_api/README.txt | |
| # TODO: ↓ 今のONNX RuntimeだとCPU用のproviderはもう無いはず | |
| # https://github.com/VOICEVOX/voicevox_core/pull/411#issuecomment-1412457592 | |
| check_not_exists_items: | | |
| additional_libraries/ | |
| - name: CpuArch指定 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --cpu-arch x86 | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| models/README.txt | |
| dict/open_jtalk_dic_utf_8-1.11 | |
| c_api/README.txt | |
| check_not_exists_items: | | |
| additional_libraries/ | |
| - name: output先指定ダウンロード | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- -o other_output | |
| download_dir: other_output | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| models/README.txt | |
| dict/open_jtalk_dic_utf_8-1.11 | |
| c_api/README.txt | |
| check_not_exists_items: | | |
| additional_libraries/ | |
| - name: Min option確認 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --min | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| c_api/README.txt | |
| check_not_exists_items: | | |
| onnxruntime/ | |
| additional_libraries/ | |
| models/ | |
| dict/ | |
| - name: DirectML option確認 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --devices directml | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| models/README.txt | |
| dict/open_jtalk_dic_utf_8-1.11 | |
| c_api/README.txt | |
| additional_libraries/DirectML.dll | |
| additional_libraries/DirectML_LICENSE.txt | |
| check_not_exists_items: | | |
| additional_libraries/*cuda* | |
| additional_libraries/*cudnn* | |
| additional_libraries/*eula* | |
| additional_libraries/*nvidia* | |
| additional_libraries/*cufft* | |
| additional_libraries/*curand* | |
| - name: DirectMLかつMin option確認 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --devices directml --min | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/README.txt | |
| c_api/lib/voicevox_core.dll | |
| check_not_exists_items: | | |
| onnxruntime/ | |
| additional_libraries/ | |
| models/ | |
| dict/ | |
| - name: cuda option確認 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --devices cuda | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| models/README.txt | |
| dict/open_jtalk_dic_utf_8-1.11 | |
| c_api/README.txt | |
| additional_libraries/EULA.txt | |
| additional_libraries/NVIDIA_SLA_cuDNN_Support.txt | |
| additional_libraries/cublas64_*.dll | |
| additional_libraries/cublasLt64_*.dll | |
| additional_libraries/cudart64_*.dll | |
| additional_libraries/cudnn64_*.dll | |
| additional_libraries/cudnn_adv_infer64_*.dll | |
| additional_libraries/cudnn_cnn_infer64_*.dll | |
| additional_libraries/cudnn_ops_infer64_*.dll | |
| additional_libraries/cufft64_*.dll | |
| additional_libraries/curand64_*.dll | |
| check_not_exists_items: | | |
| additional_libraries/*directml* | |
| - name: cudaかつmin option確認 | |
| os: windows-latest | |
| download_command: cargo run -v -p downloader -- --devices cuda --min | |
| download_dir: voicevox_core | |
| check_items: | | |
| c_api/lib/voicevox_core.dll | |
| c_api/README.txt | |
| check_not_exists_items: | | |
| onnxruntime/ | |
| additional_libraries/ | |
| models/ | |
| dict/ | |
| runs-on: ${{ matrix.os }} | |
| name: ${{ matrix.name }}-${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Rust | |
| uses: ./.github/actions/rust-toolchain-from-file | |
| - name: Get prerelease latest version | |
| if: ${{ env.VERSION == 'prerelease-latest' }} | |
| run: | | |
| VERSION=$( | |
| curl -sSf --retry 3 --retry-delay 5 https://api.github.com/repos/VOICEVOX/voicevox_core/releases \ | |
| -H 'authorization: Bearer ${{ github.token }}' \ | |
| -H 'content-type: application/json' | | |
| jq -er 'map(select(.draft | not)) | .[0].tag_name' | |
| ) | |
| echo "VERSION=$VERSION" >> "$GITHUB_ENV" | |
| - name: Execute download command | |
| # TODO: `voicevox_onnxruntime-1.17.3`のprerelease指定を外したら`--onnxruntime-version`はlatest指定にする | |
| # TODO: voicevox_vvm 0.16.0のprerelease指定を外したら`--models-version`の指定をやめる | |
| # `"y"`を流し込むことで「利用規約への同意」を行う | |
| # (この際`echo y`ではなく`yes`を使うと謎の要因により無言で異常終了する) | |
| run: echo y | ${{ matrix.download_command }} --c-api-version ${{ env.VERSION }} --c-api-repo ${{ github.repository }} --onnxruntime-version voicevox_onnxruntime-1.17.3 --models-version 0.16.0 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check downloaded version | |
| run: | | |
| [ -e "${{ matrix.download_dir }}/c_api/VERSION" ] | |
| [ "$(cat "${{ matrix.download_dir }}/c_api/VERSION")" = "${{ env.VERSION }}" ] | |
| - name: Check downloaded files | |
| run: | | |
| mapfile -t items < <(echo -n '${{ matrix.check_items }}') | |
| for item in "${items[@]}" | |
| do | |
| echo "check exists ${{ matrix.download_dir }}/${item}..." | |
| # shellcheck disable=SC2086 | |
| [ -e "${{ matrix.download_dir }}"/${item} ] | |
| done | |
| - name: Check should not exists files | |
| run: | | |
| mapfile -t items < <(echo -n '${{ matrix.check_not_exists_items }}') | |
| for item in "${items[@]}" | |
| do | |
| echo "check should not exists ${{ matrix.download_dir }}/${item}..." | |
| # shellcheck disable=SC2086 | |
| [ ! -e "${{ matrix.download_dir }}"/${item} ] | |
| done |