Skip to content
Open
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
27 changes: 27 additions & 0 deletions .github/actions/cache-onnxruntime/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Cache ONNX Runtime
description: voicevox-ortクレートがダウンロードするONNX Runtimeをキャッシュする。voicevox-ortがシンボリックリンクを利用するmacOSとLinuxだけ対象で、Windowsは対象外。
Copy link
Member

Choose a reason for hiding this comment

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

これaction名から予測できないですね!
重要だし簡単に反映できそうだしで、action名をcache-onnxruntime-xymlinkとかにしても良いかも?


inputs:
key:
required: true

runs:
using: composite
steps:
- id: cache-dir-location
shell: bash
run: |
case "$RUNNER_OS" in
macOS) cache_dir=/Users/runner/Library/Caches ;;
Linux) cache_dir=/home/runner/.cache ;;
*)
echo 'OS must be macOS or Linux' >&2
exit 1
esac

echo cache-dir=$cache_dir >> "$GITHUB_OUTPUT"

- uses: actions/cache@v4
with:
key: ${{ inputs.key }}
path: ${{ steps.cache-dir-location.outputs.cache-dir }}/voicevox_ort/dfbin
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ jobs:
python-version: "3.10"
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
- name: Cache ONNX Runtime
if: runner.os == 'macOS' || runner.os == 'Linux'
uses: ./.github/actions/cache-onnxruntime
with:
key: cargo-integration-test-ort-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }}
- uses: Swatinem/rust-cache@v2
with:
key: "cargo-integration-test-cache-${{ matrix.os }}"
Expand Down
Loading