Skip to content

Commit

Permalink
Merge branch 'master' into refactor/lib_model_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tarepan committed May 29, 2024
2 parents 5bccebb + 718c89e commit 9a4b489
Show file tree
Hide file tree
Showing 70 changed files with 1,091 additions and 714 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,19 @@ jobs:
uses: actions/checkout@v4

- name: <Setup> Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: <Setup> Install Python dependencies
run: |
pip install -r requirements.txt
run: pip install -r requirements.txt

- name: <Build> Make documents
run: |
PYTHONPATH=. python build_util/make_docs.py
run: PYTHONPATH=. python build_util/make_docs.py

- name: <Deploy> Deploy documents to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-engine-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@ jobs:
uses: actions/checkout@v4

- name: <Setup> Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: <Setup> Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: <Setup> Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: <Setup> Prepare VOICEVOX RESOURCE cache
uses: actions/cache@v3
uses: actions/cache@v4
id: voicevox-resource-cache
with:
key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
Expand All @@ -118,7 +118,7 @@ jobs:
run: bash build_util/process_voicevox_resource.bash

- name: <Build/Deploy> Build and Deploy Docker image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
env:
IMAGE_TAG:
|- # If it's a release, add the version, otherwise add the `latest`
Expand Down
47 changes: 20 additions & 27 deletions .github/workflows/build-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ jobs:
steps:
- name: <Setup> Declare variables
id: vars
run: |
echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> "$GITHUB_OUTPUT"
run: echo "package_name=voicevox_engine-${{ matrix.target }}-${{ needs.config.outputs.version }}" >> "$GITHUB_OUTPUT"

- name: <Setup> Check out the repository
uses: actions/checkout@v4
Expand All @@ -118,8 +117,7 @@ jobs:
# so you need to install GNU 'sed' and 'split'.
- name: <Setup> Install dependencies (macOS)
if: startsWith(matrix.os, 'macos-')
run: |
brew install gnu-sed coreutils
run: brew install gnu-sed coreutils

# ONNX Runtime providersとCUDA周りをリンクするために使う
- name: <Setup> Install ONNX Runtime dependencies (Linux)
Expand All @@ -131,7 +129,7 @@ jobs:
# CUDA
- name: <Setup> Restore cached CUDA
if: matrix.cuda_version != ''
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cuda-dll-cache-restore
with:
# update this key when ONNX Runtime CUDA dependency changed
Expand All @@ -140,7 +138,7 @@ jobs:

- name: <Setup> Set up CUDA toolkit
if: matrix.cuda_version != '' && steps.cuda-dll-cache-restore.outputs.cache-hit != 'true'
uses: Jimver/[email protected].10
uses: Jimver/[email protected].15
id: cuda-toolkit
with:
method: network
Expand Down Expand Up @@ -185,7 +183,7 @@ jobs:
- name: <Setup> Save CUDA cache
if: matrix.cuda_version != ''
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.cuda-dll-cache-restore.outputs.cache-primary-key }}
path: download/cuda
Expand All @@ -197,7 +195,7 @@ jobs:

- name: <Setup> Restore cached cuDNN
if: matrix.cudnn_url != ''
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cudnn-dll-cache-restore
with:
# update this key when ONNX Runtime cuDNN dependency changed
Expand Down Expand Up @@ -239,7 +237,7 @@ jobs:
- name: <Setup> Save cuDNN cache
if: matrix.cudnn_url != ''
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.cudnn-dll-cache-restore.outputs.cache-primary-key }}
path: download/cudnn
Expand All @@ -251,7 +249,7 @@ jobs:

- name: <Setup> Restore cached zlib
if: matrix.zlib_url != ''
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: zlib-cache-restore
with:
key: zlib-cache-v1-${{ hashFiles('download/zlib_url.txt') }}
Expand All @@ -271,7 +269,7 @@ jobs:
- name: <Setup> Save zlib cache
if: matrix.zlib_url != ''
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.zlib-cache-restore.outputs.cache-primary-key }}
path: download/zlib
Expand All @@ -282,14 +280,13 @@ jobs:

# Python install path of windows: C:/hostedtoolcache/windows/Python
- name: <Setup> Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip

- name: <Setup> Install Python dependencies
run: python -m pip install -r requirements-dev.txt
run: pip install -r requirements-build.txt

- name: <Setup> Prepare custom PyInstaller
if: startsWith(matrix.os, 'windows-')
Expand Down Expand Up @@ -323,7 +320,7 @@ jobs:

- name: <Setup> Restore cached DirectML
if: endswith(matrix.target, '-directml')
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: directml-cache-restore
with:
key: directml-cache-v1-${{ hashFiles('download/directml_url.txt') }}
Expand All @@ -343,7 +340,7 @@ jobs:
- name: <Setup> Save DirectML cache
if: endswith(matrix.target, '-directml')
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.directml-cache-restore.outputs.cache-primary-key }}
path: download/directml
Expand All @@ -353,7 +350,7 @@ jobs:
run: echo "${{ matrix.onnxruntime_url }}" > download/onnxruntime_url.txt

- name: <Setup> Restore cached ONNX Runtime
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: onnxruntime-cache-restore
with:
key: ${{ matrix.os }}-onnxruntime-${{ hashFiles('download/onnxruntime_url.txt') }}-v1
Expand Down Expand Up @@ -388,14 +385,14 @@ jobs:
rm download/onnxruntime.tgz
- name: <Setup> Save ONNX Runtime cache
uses: actions/cache/save@v3
uses: actions/cache/save@v4
with:
key: ${{ steps.onnxruntime-cache-restore.outputs.cache-primary-key }}
path: download/onnxruntime

# VOICEVOX RESOURCE
- name: <Setup> Prepare RESOURCE cache
uses: actions/cache@v3
uses: actions/cache@v4
id: voicevox-resource-cache
with:
key: voicevox-resource-${{ env.VOICEVOX_RESOURCE_VERSION }}
Expand All @@ -416,7 +413,7 @@ jobs:

# VOICEVOX CORE
- name: <Setup> Prepare CORE cache
uses: actions/cache@v3
uses: actions/cache@v4
id: voicevox-core-cache
with:
key: ${{ matrix.os }}-voicevox-core-${{ matrix.voicevox_core_asset_prefix }}-${{ env.VOICEVOX_CORE_VERSION }}
Expand Down Expand Up @@ -550,21 +547,18 @@ jobs:
- name: <Setup> Set @rpath to @executable_path
if: startsWith(matrix.os, 'macos-')
run: |
install_name_tool -add_rpath @executable_path/. dist/run/run
run: install_name_tool -add_rpath @executable_path/. dist/run/run

- name: <Build> Code signing
if: github.event.inputs.code_signing == 'true' && startsWith(matrix.os, 'windows-')
run: |
bash build_util/codesign.bash "dist/run/run.exe"
run: bash build_util/codesign.bash "dist/run/run.exe"
env:
ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }}
ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }}
ESIGNERCKA_TOTP_SECRET: ${{ secrets.ESIGNERCKA_TOTP_SECRET }}

- name: <Build> Rename artifact directory to archive
run: |
mv dist/run/ "${{ matrix.target }}/"
run: mv dist/run/ "${{ matrix.target }}/"

# 7z archives
- name: <Build> Create 7z archives
Expand Down Expand Up @@ -597,8 +591,7 @@ jobs:
commit: ${{ github.sha }}

- name: <Setup> Clean 7z archives to reduce disk usage
run: |
rm -f ${{ steps.vars.outputs.package_name }}.7z.*
run: rm -f ${{ steps.vars.outputs.package_name }}.7z.*

# VVPP archives
- name: <Build> Create VVPP archives
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-engine-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ jobs:
cache: pip

- name: <Setup> Install Python dependencies
run: |
pip install -r requirements-test.txt
run: pip install -r requirements-test.txt

- name: <Setup> Declare variables
id: docker_vars
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-engine-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ jobs:
run: chmod +x dist/run

- name: <Setup> Install Python test dependencies
run: |
pip install -r requirements-test.txt
run: pip install -r requirements-test.txt

- name: <Test> Test ENGINE package
run: python build_util/check_release_build.py --dist_dir dist/
2 changes: 1 addition & 1 deletion .github/workflows/test-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: pip install -r requirements-test.txt

- name: <Test> Check Python dependency security
run: safety check -r requirements.txt -r requirements-dev.txt -r requirements-test.txt -r requirements-license.txt -o bare
run: safety check -r requirements.txt -r requirements-test.txt -r requirements-build.txt -r requirements-license.txt -o bare

- name: <Deploy> Notify Discord of security testing result
uses: sarisia/actions-status-discord@v1
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: test
on:
push:
pull_request:
branches:
- "**"
workflow_dispatch:

defaults:
Expand Down Expand Up @@ -32,7 +30,7 @@ jobs:
cache: pip

- name: <Setup> Install Python dependencies
run: python -m pip install -r requirements-test.txt
run: pip install -r requirements-test.txt

- name: <Test> Validate poetry.lock
run: |
Expand All @@ -42,13 +40,13 @@ jobs:
- name: <Test> Check dependency lists
run: |
poetry export --without-hashes -o requirements.txt.check
poetry export --without-hashes --with dev -o requirements-dev.txt.check
poetry export --without-hashes --with test -o requirements-test.txt.check
poetry export --without-hashes --with build -o requirements-build.txt.check
poetry export --without-hashes --with license -o requirements-license.txt.check
diff -q requirements.txt requirements.txt.check || \
diff -q requirements-dev.txt requirements-dev.txt.check || \
diff -q requirements-test.txt requirements-test.txt.check || \
diff -q requirements-build.txt requirements-build.txt.check || \
diff -q requirements-license.txt requirements-license.txt.check > /dev/null
if [ $? = 1 ]; then
echo "poetry export has some diff"
Expand All @@ -60,21 +58,19 @@ jobs:

- name: <Test> Test codes and coverage
run: coverage run --omit=test/* -m pytest

- name: <Deploy> Submit coverage results to Coveralls
if: matrix.os == 'ubuntu-20.04'
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: <Test> Check licenses
shell: bash
run: |
OUTPUT_LICENSE_JSON_PATH=/dev/null \
bash build_util/create_venv_and_generate_licenses.bash
run: OUTPUT_LICENSE_JSON_PATH=/dev/null bash build_util/create_venv_and_generate_licenses.bash

- name: <Test> Test names by checking typo
if: matrix.os == 'ubuntu-20.04'
uses: crate-ci/typos@v1.12.12
uses: crate-ci/typos@v1.21.0

lint-builders:
runs-on: ubuntu-20.04
Expand All @@ -94,4 +90,3 @@ jobs:
run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint
shell: bash
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ repos:
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-dev
name: poetry-export-dev
entry: poetry export --without-hashes --with dev -o requirements-dev.txt
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-test
name: poetry-export-test
entry: poetry export --without-hashes --with test -o requirements-test.txt
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-build
name: poetry-export-build
entry: poetry export --without-hashes --with build -o requirements-build.txt
language: python
stages: [push]
pass_filenames: false
- id: poetry-export-license
name: poetry-export-license
entry: poetry export --without-hashes --with license -o requirements-license.txt
Expand Down
Loading

0 comments on commit 9a4b489

Please sign in to comment.