Skip to content

Commit 897435e

Browse files
committed
Update: CI 実行時に毎回デフォルトモデルのダウンロードが発生しないよう、デフォルトモデルをキャッシュする
1 parent 4dc7398 commit 897435e

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

.github/workflows/build-engine-package.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,24 +119,6 @@ jobs:
119119
if: startsWith(matrix.os, 'windows-')
120120
run: ./tools/modify_pyinstaller.bash
121121

122-
- name: <Setup> Download pyopenjtalk dictionary
123-
run: |
124-
# try 5 times, sleep 5 seconds before retry
125-
for _ in $(seq 5); do
126-
EXIT_CODE=0
127-
poetry run python -c "import pyopenjtalk; pyopenjtalk._lazy_init()" || EXIT_CODE=$?
128-
129-
if [ "$EXIT_CODE" = "0" ]; then
130-
break
131-
fi
132-
133-
sleep 5
134-
done
135-
136-
if [ "$EXIT_CODE" != "0" ]; then
137-
exit "$EXIT_CODE"
138-
fi
139-
140122
- name: <Setup> Create download directory
141123
run: mkdir -p download/
142124

.github/workflows/test-engine-container.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ jobs:
5454
path: ~/.cache/pypoetry
5555
key: ${{ runner.os }}-${{ runner.arch }}-poetry-${{ hashFiles('**/poetry.lock') }}
5656

57+
- name: <Setup> Cache Engine Data
58+
uses: actions/cache@v4
59+
with:
60+
path: ~/.local/share/AivisSpeech-Engine
61+
key: ${{ runner.os }}-${{ runner.arch }}-engine-data
62+
5763
- name: <Setup> Install Python dependencies
5864
run: poetry install --with=dev
5965

@@ -70,7 +76,7 @@ jobs:
7076
run: docker pull "${{ steps.docker_vars.outputs.image_tag }}"
7177

7278
- name: <Setup> Run ENGINE application docker container
73-
run: docker run -d -p 10101:10101 "${{ steps.docker_vars.outputs.image_tag }}"
79+
run: docker run -d -p 10101:10101 -v ~/.local/share/AivisSpeech-Engine:/home/user/.local/share/AivisSpeech-Engine "${{ steps.docker_vars.outputs.image_tag }}"
7480

7581
# Docker コンテナが起動してから、レスポンスが返ってくるまで待機する
7682
# リトライは10回まで `/version` にアクセスしてレスポンスのステータスコードをチェック

.github/workflows/test-engine-package.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ jobs:
7373
path: ~/.cache/pypoetry
7474
key: ${{ runner.os }}-${{ runner.arch }}-poetry-${{ hashFiles('**/poetry.lock') }}
7575

76+
- name: <Setup> Cache Engine Data
77+
uses: actions/cache@v4
78+
with:
79+
path: ~/.local/share/AivisSpeech-Engine
80+
key: ${{ runner.os }}-${{ runner.arch }}-engine-data
81+
7682
- name: <Setup> Download ENGINE package
7783
env:
7884
GH_TOKEN: ${{ github.token }}

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
path: ~/.cache/pypoetry
4242
key: ${{ runner.os }}-${{ runner.arch }}-poetry-${{ hashFiles('**/poetry.lock') }}
4343

44+
- name: <Setup> Cache Engine Data
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.local/share/AivisSpeech-Engine
48+
key: ${{ runner.os }}-${{ runner.arch }}-engine-data
49+
4450
- name: <Setup> Install Python dependencies
4551
run: poetry install --with=dev
4652

0 commit comments

Comments
 (0)