Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

directml用release buildを作成 #210

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
- 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 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新しくfeatureができたとき、ここのテストに足し忘れる(設定し忘れる)のって防止できたりしそうでしょうか。
(たぶん防止方法は無いと思っていて、気をつけようかなと思っています)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これは気をつけるしか無いですね


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