Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download_test.ymlのmatrix.expected_versionは不要なのではないか #310

Closed
qryxip opened this issue Oct 16, 2022 · 3 comments · Fixed by #341
Closed

download_test.ymlのmatrix.expected_versionは不要なのではないか #310

qryxip opened this issue Oct 16, 2022 · 3 comments · Fixed by #341

Comments

@qryxip
Copy link
Member

qryxip commented Oct 16, 2022

内容

download_test.ymlにactionlintをかけたらmatrix.expected_versionがどこにも定義されていないことに気づきました。

#249 の経緯があまりよくわかっていないのですが、既に不要な部分ではないかと思います。

actionlint .github/workflows/download_test.yml
.github/workflows/download_test.yml:238:43: property "expected_version" is not defined in object type {check_items: string; check_not_exists_items: string; download_command: string; download_dir: string; name: string; os: string} [expression]
    |
238 |       EXPECTED_VOICEVOX_CORE_VERSION: ${{ matrix.expected_version || 'latest' }}
    |                                           ^~~~~~~~~~~~~~~~~~~~~~~
.github/workflows/download_test.yml:246:9: shellcheck reported issue in this script: SC2086:info:1:231: Double quote to prevent globbing and word splitting [shellcheck]
    |
246 |         run: |
    |         ^~~~
.github/workflows/download_test.yml:255:9: shellcheck reported issue in this script: SC2207:warning:1:8: Prefer mapfile or read -a to split command output (or quote to avoid splitting) [shellcheck]
    |
255 |         run: |
    |         ^~~~
.github/workflows/download_test.yml:255:9: shellcheck reported issue in this script: SC2086:info:5:37: Double quote to prevent globbing and word splitting [shellcheck]
    |
255 |         run: |
    |         ^~~~
.github/workflows/download_test.yml:264:9: shellcheck reported issue in this script: SC2207:warning:1:8: Prefer mapfile or read -a to split command output (or quote to avoid splitting) [shellcheck]
    |
264 |         run: |
    |         ^~~~
.github/workflows/download_test.yml:264:9: shellcheck reported issue in this script: SC2086:info:5:39: Double quote to prevent globbing and word splitting [shellcheck]
    |
264 |         run: |
    |         ^~~~

env:
EXPECTED_VOICEVOX_CORE_VERSION: ${{ matrix.expected_version || 'latest' }}
steps:
- uses: actions/checkout@v2
- name: Execute download command
run: ${{ matrix.download_command }}
- name: Get latest version
if: ${{ env.EXPECTED_VOICEVOX_CORE_VERSION == 'latest' }}
shell: bash
run: |
echo "EXPECTED_VOICEVOX_CORE_VERSION=$(curl -sSfI "https://github.com/VOICEVOX/voicevox_core/releases/latest"| grep "location:" | sed -e "s%location: https://github.com/VOICEVOX/voicevox_core/releases/tag/%%" | sed 's/\r//g')" >> $GITHUB_ENV
- name: Check downloaded version
shell: bash
run: |
[ -e "${{ matrix.download_dir }}/VERSION" ]
[ "$(cat "${{ matrix.download_dir }}/VERSION")" = "${{ env.EXPECTED_VOICEVOX_CORE_VERSION }}" ]

Pros 良くなる点

Cons 悪くなる点

実現方法

OSの種類/ディストリ/バージョン

その他

@Hiroshiba
Copy link
Member

おそらくダウンロードバージョンを指定可能にするというモチベーションがあったのかなと思いました!
となると、どちらかというと指定可能になっていない点が課題かも・・・?

@qwerty2501
Copy link
Contributor

ダウンロードスクリプトがリリースされた後の過去バージョン指定してダウンロードできることを確認するモチベがあったため書いたのですが、まだその過去バージョンがないためケースとしては追加しなかった記憶があります。
lint通すのが目的ならとりあえず消しても良いかも?

@Hiroshiba
Copy link
Member

なるほどです、となるとコメントアウトして目的を書けば良さそうですね・・・!

@qryxip qryxip linked a pull request Dec 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants