Skip to content

Commit

Permalink
追加: ShellCheck CI (VOICEVOX#1125)
Browse files Browse the repository at this point in the history
* add: ShellCheck CI

* fix: パス解決 lint エラーを回避

* fix: ls-grep を if で置き換え

* fix: grep を glob で置換し lint エラーを解消

* refactor: workflow step 名を明確化

* fix: workflow ジョブ名を明確化

Co-authored-by: Hiroshiba <[email protected]>

---------

Co-authored-by: Hiroshiba <[email protected]>
  • Loading branch information
tarepan and Hiroshiba authored May 14, 2024
1 parent 9751d6e commit 01fcc6d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,17 @@ jobs:
- name: Test names by checking typo
if: ${{ startsWith(matrix.os, 'ubuntu-') }}
uses: crate-ci/[email protected]

shellcheck:
runs-on: ubuntu-20.04
steps:
- name: <Setup> Check out the repository
uses: actions/checkout@v4

- name: <Setup> Install ShellCheck
run: |
sudo apt-get update
sudo apt-get install -y shellcheck
- name: <Test> Check shell files
run: git ls-files | grep -E '\.(ba)?sh' | xargs shellcheck
4 changes: 2 additions & 2 deletions build_util/create_venv_and_generate_licenses.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ VENV_PATH="licenses_venv"

python -m venv $VENV_PATH
if [ -d "$VENV_PATH/Scripts" ]; then
# shellcheck disable=SC1091
# shellcheck disable=SC1091,SC1090
source $VENV_PATH/Scripts/activate
else
# shellcheck disable=SC1091
# shellcheck disable=SC1091,SC1090
source $VENV_PATH/bin/activate
fi

Expand Down
6 changes: 4 additions & 2 deletions build_util/process_voicevox_resource.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ python build_util/merge_update_infos.py \
"${DOWNLOAD_RESOURCE_PATH}/engine/engine_manifest_assets/update_infos.json" \
engine_manifest_assets/update_infos.json

for f in $(ls "${DOWNLOAD_RESOURCE_PATH}"/engine/engine_manifest_assets/* | grep -v update_infos.json); do
cp "${f}" ./engine_manifest_assets/
for f in "${DOWNLOAD_RESOURCE_PATH}"/engine/engine_manifest_assets/*; do
if [ "$(basename "${f}")" != "update_infos.json" ]; then
cp "${f}" ./engine_manifest_assets/
fi
done

0 comments on commit 01fcc6d

Please sign in to comment.