Skip to content

Commit

Permalink
directml用release buildを作成 (VOICEVOX#210)
Browse files Browse the repository at this point in the history
* directml用release buildを作成

* onnxruntimeを0.0.29にバージョンアップ

* CIテストをfeatures指定で動作するようにしてテストが通るようにした

* lint時にはdownlaodを行わないようにした
  • Loading branch information
qwerty2501 authored Aug 2, 2022
1 parent 6570c0d commit 6dfaa72
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
target: x86_64-pc-windows-msvc
artifact_name: windows-x64-cpu
use_cuda: false
- os: windows-latest
feature: directml
target: x86_64-pc-windows-msvc
artifact_name: windows-x64-directml
use_cuda: false
- os: windows-latest
feature: default
target: x86_64-pc-windows-msvc
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
- run: cargo clippy --all-features --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy --all-features -- -D clippy::all -D warnings --no-deps
- run: cargo clippy --all-features --features onnxruntime/disable-sys-build-script --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy --all-features --features onnxruntime/disable-sys-build-script -- -D clippy::all -D warnings --no-deps
- run: cargo fmt -- --check

rust-test:
Expand All @@ -24,11 +24,21 @@ jobs:
matrix:
include:
- os: windows-2019
features: default
- os: windows-2022
features: default
- os: windows-2019
features: directml
- os: windows-2022
features: directml
- os: macos-11
features: default
- os: macos-12
features: default
- os: ubuntu-18.04
features: default
- os: ubuntu-20.04
features: default
runs-on: ${{ matrix.os }}
steps:
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
Expand All @@ -47,7 +57,7 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
# cargoのキャッシュが原因でテストが失敗する場合はバージョン部分をカウントアップすること
key: "v1-cargo-test-cache-${{ matrix.os }}"
key: "v1-cargo-test-cache-${{ matrix.features }}-${{ matrix.os }}"
# FIXME: windows-2022 では、onnxruntime-sys のビルド時にダウンロードされる onnxruntime.dll に対してパスが通らないために、テストが行えない
# 原因が不明であるため、姑息的な回避策として target/debug/deps ディレクトリに onnxruntime.dll をコピーする。根本的な解決策を望む。
# cf. https://github.com/VOICEVOX/voicevox_core/pull/140#issuecomment-1140276585
Expand All @@ -58,7 +68,7 @@ jobs:
cargo build
find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0
find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0 | head -n 1 | xargs -i cp {} target/debug/deps/
- run: cargo test --all-features
- run: cargo test --features ${{ matrix.features }}

build-unix-cpp-example:
strategy:
Expand Down
13 changes: 7 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[features]
default = []
directml = []
directml = ["onnxruntime/directml"]

[lib]
name = "core"
Expand All @@ -18,7 +18,7 @@ derive-getters = "0.2.0"
derive-new = "0.5.9"
libc = "0.2.126"
once_cell = "1.10.0"
onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", version = "0.0.27" }
onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", version = "0.0.28" }
serde = "1.0.137"
serde_json = "1.0.81"
thiserror = "1.0.31"
Expand Down

0 comments on commit 6dfaa72

Please sign in to comment.