Skip to content

Commit

Permalink
Merge branch 'main' into use-c-string-literal
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Oct 13, 2024
2 parents ddbb62c + b82f7dc commit f6d73d2
Show file tree
Hide file tree
Showing 175 changed files with 8,825 additions and 4,703 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ xtask = "run -p xtask --"
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }

# Windows環境でテストエラーになるのを防ぐために設定するworkaround
# https://github.com/VOICEVOX/onnxruntime-rs/issues/3#issuecomment-1207381367
ORT_OUT_DIR = { value = "target/debug/deps", relative = true }

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

Expand Down
3 changes: 3 additions & 0 deletions .github/actions/create-venv/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: Create venv
description: Pythonの仮想環境を作成し、$PATHと$VIRTUAL_ENVを設定する。

runs:
using: composite
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/rust-toolchain-from-file/action.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
name: rustup toolchain install from file
description: rust-toolchainファイルをもとにRustのツールチェーンをインストールする。

inputs:
targets:
required: false
Expand Down
203 changes: 90 additions & 113 deletions .github/workflows/build_and_deploy.yml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions .github/workflows/build_and_deploy_downloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ jobs:

- name: download-osx-x64
target: x86_64-apple-darwin
os: macos-11
os: macos-12

- name: download-osx-arm64
target: aarch64-apple-darwin
os: macos-11
os: macos-12

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install cross compiler for aarch64-unknown-linux-gnu
if: matrix.target == 'aarch64-unknown-linux-gnu'
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:

- name: Upload to Release
if: env.VERSION != '0.0.0'
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: true
tag_name: ${{ env.VERSION }}
Expand Down
17 changes: 5 additions & 12 deletions .github/workflows/cargo-deny.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
name: cargo-deny
on:
push:
pull_request:
defaults:
run:
shell: bash
branches:
- main
jobs:
cargo-deny:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-deny
run: cargo binstall cargo-deny@^0.14 --no-confirm --log-level debug
run: cargo binstall cargo-deny@^0.16 --no-confirm --log-level debug
- name: cargo-deny
run: |
if ${{ !!github.event.release }}; then
cargo deny --all-features check
else
cargo deny --all-features check -W denied
fi
run: cargo deny --all-features check
10 changes: 5 additions & 5 deletions .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: DirectML option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --device directml
download_command: cargo run -vv -p downloader -- --devices directml
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -121,7 +121,7 @@ jobs:
*curand*
- name: DirectMLかつMin option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --device directml --min
download_command: cargo run -vv -p downloader -- --devices directml --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -139,7 +139,7 @@ jobs:
open_jtalk_dic_utf_8-1.11
- name: cuda option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --device cuda
download_command: cargo run -vv -p downloader -- --devices cuda
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -161,7 +161,7 @@ jobs:
*directml*
- name: cudaかつmin option確認
os: windows-latest
download_command: cargo run -vv -p downloader -- --device cuda --min
download_command: cargo run -vv -p downloader -- --devices cuda --min
download_dir: voicevox_core
check_items: |
voicevox_core.dll
Expand All @@ -184,7 +184,7 @@ jobs:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}-${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Get prerelease latest version
Expand Down
41 changes: 27 additions & 14 deletions .github/workflows/generate_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,36 @@ jobs:
generate_api_document:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Extract the Rust version used on Docs.rs
id: docsrs-rust-version
run: |
page=$(curl -f https://docs.rs/about/builds)
date=$(
sed -n \
's:^.*<code>rustc 1\.[0-9]\+\.[0-9]\+-nightly ([0-9a-f]\{9\} \([0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}\))</code>.*$:\1:p' \
<<< "$page"
)
echo "rust-toolchain=nightly-$date" >> "$GITHUB_OUTPUT"
- name: Set up nightly Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ steps.docsrs-rust-version.outputs.rust-toolchain }}
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
- name: Install cargo-binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install cargo-docs-rs
uses: dtolnay/install@cargo-docs-rs
- name: Create a venv
uses: ./.github/actions/create-venv
- name: Install python dependencies
Expand All @@ -39,19 +53,18 @@ jobs:
run: mkdir -p public/apis/c_api
- name: cp docs/apis/index.html
run: cp docs/apis/index.html public/apis/
- name: Generate rustdoc
run: |
cargo +${{ steps.docsrs-rust-version.outputs.rust-toolchain }} docs-rs -p voicevox_core
mv target/x86_64-unknown-linux-gnu/doc public/apis/rust_api
- name: cp crates/voicevox_core_c_api/include/voicevox_core.h
run: cp crates/voicevox_core_c_api/include/voicevox_core.h docs/apis/c_api/doxygen/
- name: Generate doxygen document
uses: mattnotmitt/[email protected].4
uses: mattnotmitt/[email protected].8
with:
working-directory: "docs/apis/c_api/doxygen"
- name: Build voicevox_core_python_api
run: |
cargo build -p voicevox_core_c_api -vv
maturin develop --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --locked
# https://github.com/readthedocs/sphinx-autoapi/issues/405
- name: Workaround to make Sphinx recognize `_rust` as a module
run: touch ./crates/voicevox_core_python_api/python/voicevox_core/_rust/__init__.py
run: maturin develop --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --locked
- name: Generate Sphinx document
run: sphinx-build docs/apis/python_api public/apis/python_api
- name: Generate Javadoc
Expand All @@ -60,7 +73,7 @@ jobs:
mkdir -p public/apis/java_api
cp -r crates/voicevox_core_java_api/lib/build/docs/javadoc/* public/apis/java_api
- name: Uplaod api document
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
if: ${{ github.ref_name == 'main' }}
with:
path: public
Expand All @@ -78,4 +91,4 @@ jobs:
steps:
- name: Deploy to GitHub pages
id: api
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions .github/workflows/java_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
java-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v2.5
- uses: github/issue-labeler@v3.4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install Poetry
Expand Down
Loading

0 comments on commit f6d73d2

Please sign in to comment.