Skip to content

Commit 698b288

Browse files
committed
ci: ダウンロードされるONNX Runtimeをキャッシュする
1 parent b4766c4 commit 698b288

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Cache ONNX Runtime
2+
description: voicevox-ortクレートがダウンロードするONNX Runtimeをキャッシュする。voicevox-ortがシンボリックリンクを利用するmacOSとLinuxだけ対象で、Windowsは対象外。
3+
4+
inputs:
5+
key:
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- id: cache-dir-location
12+
shell: bash
13+
run: |
14+
case "$RUNNER_OS" in
15+
macOS) cache_dir=/Users/runner/.cache ;;
16+
Linux) cache_dir=/home/runner/Library/Caches ;;
17+
*)
18+
echo 'OS must be macOS or Linux' >&2
19+
exit 1
20+
esac
21+
22+
echo cache-dir=$cache_dir >> "$GITHUB_OUTPUT"
23+
24+
- uses: actions/cache@v4
25+
with:
26+
key: ${{ inputs.key }}
27+
path: ${{ steps.cache-dir-location.outputs.cache-dir }}/voicevox_ort/dfbin

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ jobs:
166166
python-version: "3.10"
167167
- name: Set up Rust
168168
uses: ./.github/actions/rust-toolchain-from-file
169+
- name: Cache ONNX Runtime
170+
if: runner.os == 'macOS' || runner.os == 'Linux'
171+
uses: ./.github/actions/cache-onnxruntime
172+
with:
173+
key: cargo-integration-test-ort-${{ matrix.os }}
169174
- uses: Swatinem/rust-cache@v2
170175
with:
171176
key: "cargo-integration-test-cache-${{ matrix.os }}"

0 commit comments

Comments
 (0)