From a752f57ff0439f969ec74410d911ba736bcb5f2f Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 05:02:59 +0900 Subject: [PATCH 01/10] =?UTF-8?q?test:e2e=E3=82=92linux=E3=81=A8mac?= =?UTF-8?q?=E3=81=A7=E3=82=82=E5=8B=95=E3=81=8F=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 42a3daa9fa..049769d5bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,9 @@ env: defaults: run: shell: bash - + jobs: + # ビルドのテスト build-test: runs-on: windows-latest steps: @@ -23,7 +24,8 @@ jobs: uses: ./.github/actions/setup-environment - run: npm run electron:build_pnever - test: + # unit テスト + unit-test: runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -39,6 +41,13 @@ jobs: version: ${{ env.VOICEVOX_ENGINE_VERSION }} dest: ${{ github.workspace }}/voicevox_engine + # electron の e2e テスト + e2e-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + steps: - name: Run npm run test:e2e run: | cp .env.test .env From fffb94ded8e447962ec65e9c95334679872a9c53 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 05:06:58 +0900 Subject: [PATCH 02/10] =?UTF-8?q?=E5=BF=98=E3=82=8C=E3=81=A6=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 049769d5bf..d9e753ffe0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,13 +34,6 @@ jobs: - run: npm run test:unit - - name: Download VOICEVOX ENGINE - id: download-engine - uses: ./.github/actions/download-engine - with: - version: ${{ env.VOICEVOX_ENGINE_VERSION }} - dest: ${{ github.workspace }}/voicevox_engine - # electron の e2e テスト e2e-test: runs-on: ${{ matrix.os }} @@ -48,6 +41,17 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: + - uses: actions/checkout@v3 + - name: Setup environment + uses: ./.github/actions/setup-environment + + - name: Download VOICEVOX ENGINE + id: download-engine + uses: ./.github/actions/download-engine + with: + version: ${{ env.VOICEVOX_ENGINE_VERSION }} + dest: ${{ github.workspace }}/voicevox_engine + - name: Run npm run test:e2e run: | cp .env.test .env From 3bf589a597b594fb5adb5ad329db6e76b29447d7 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 05:17:21 +0900 Subject: [PATCH 03/10] macOS --- .github/actions/download-engine/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/download-engine/action.yml b/.github/actions/download-engine/action.yml index 4c61fcd9d0..ef64a6dcaf 100644 --- a/.github/actions/download-engine/action.yml +++ b/.github/actions/download-engine/action.yml @@ -52,8 +52,8 @@ runs: shell: bash run: | if [ "${{ inputs.target }}" = "" ]; then - OS="${{ runner.os }}" - TARGET="${OS,,}-cpu" # 小文字にする + OS=$(echo "${{ runner.os }}" | tr "[:upper:]" "[:lower:]") # 小文字にする + TARGET="$OS-cpu" else TARGET="${{ inputs.target }}" fi From dfe0ba5fb165c84fa93cc2b3dae60937ee6bf2ef Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 06:46:51 +0900 Subject: [PATCH 04/10] xvfb-run --- .github/workflows/test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d9e753ffe0..15c7b4fa32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,12 @@ jobs: - name: Setup environment uses: ./.github/actions/setup-environment + - name: Install xvfb and x11-xserver-utils + if: startsWith(matrix.os, 'ubuntu') + run: | + sudo apt-get update + sudo apt-get install -y xvfb x11-xserver-utils + - name: Download VOICEVOX ENGINE id: download-engine uses: ./.github/actions/download-engine @@ -56,8 +62,12 @@ jobs: run: | cp .env.test .env sed -i -e 's|"../voicevox_engine/run.exe"|"${{ steps.download-engine.outputs.run_path }}"|' .env + if [ -n "${{ runner.debug }}" ]; then - DEBUG=pw:browser* npm run test:e2e + export DEBUG="pw:browser*" + fi + if [[ ${{ matrix.os }} == ubuntu-* ]]; then + xvfb-run --auto-servernum npm run test:e2e else npm run test:e2e fi From bfc584b084837cc9e76fbba5e8453e0e7565b76d Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 10:40:24 +0900 Subject: [PATCH 05/10] =?UTF-8?q?mac=E3=81=AFURL=E3=81=8C=E9=81=95?= =?UTF-8?q?=E3=81=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15c7b4fa32..e918bd3ade 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,6 +40,13 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: ubuntu-latest + voicevox_engine_asset_name: linux-cpu + - os: macos-latest + voicevox_engine_asset_name: macos-x64 + - os: windows-latest + voicevox_engine_asset_name: windows-cpu steps: - uses: actions/checkout@v3 - name: Setup environment @@ -57,6 +64,7 @@ jobs: with: version: ${{ env.VOICEVOX_ENGINE_VERSION }} dest: ${{ github.workspace }}/voicevox_engine + target: ${{ matrix.voicevox_engine_asset_name }} - name: Run npm run test:e2e run: | From 0bf151b8b406407aa06a2928544d0e4af58294a0 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Fri, 21 Jul 2023 11:08:41 +0900 Subject: [PATCH 06/10] 180000 --- tests/e2e/example.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/example.spec.ts b/tests/e2e/example.spec.ts index 5a6d74ee52..a4bcdf8510 100644 --- a/tests/e2e/example.spec.ts +++ b/tests/e2e/example.spec.ts @@ -39,7 +39,7 @@ test.beforeAll(async () => { test("起動したら「利用規約に関するお知らせ」が表示される", async () => { const app = await electron.launch({ args: ["."], - timeout: process.env.CI ? 0 : 60000, + timeout: process.env.CI ? 0 : 180000, env: { ...process.env, VITE_DEV_SERVER_URL: "http://localhost:5173", From 3fa05aeaa68aea23d78ecd4b394fd2fdcd0d2c41 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 22 Jul 2023 00:47:25 +0900 Subject: [PATCH 07/10] nemo --- .github/actions/download-engine/action.yml | 6 +++++- .github/workflows/test.yml | 1 + tests/e2e/example.spec.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/download-engine/action.yml b/.github/actions/download-engine/action.yml index ef64a6dcaf..f47830c17a 100644 --- a/.github/actions/download-engine/action.yml +++ b/.github/actions/download-engine/action.yml @@ -2,6 +2,10 @@ name: "Download VOICEVOX ENGINE" description: | VOICEVOX ENGINEをダウンロードし、指定したディレクトリに展開する。 inputs: + repo: + description: "リポジトリ名。デフォルトはVOICEVOX/voicevox_engine。" + required: false + default: "VOICEVOX/voicevox_engine" version: description: "VOICEVOX ENGINEのバージョン。latest(デフォルト)、prerelease-latest、バージョン番号(例:0.14.4)で指定できる。" required: false @@ -37,7 +41,7 @@ runs: - name: Get version shell: bash run: | - curl -s https://api.github.com/repos/voicevox/voicevox_engine/releases \ + curl -s https://api.github.com/repos/${{ inputs.repo }}/releases \ -H 'authorization: Bearer ${{ github.token }}' \ -H 'content-type: application/json' > $TEMPDIR/releases.json diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e918bd3ade..b461df01b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,6 +62,7 @@ jobs: id: download-engine uses: ./.github/actions/download-engine with: + repo: VOICEVOX/voicevox_nemo_engine # 軽いのでNemoを使う version: ${{ env.VOICEVOX_ENGINE_VERSION }} dest: ${{ github.workspace }}/voicevox_engine target: ${{ matrix.voicevox_engine_asset_name }} diff --git a/tests/e2e/example.spec.ts b/tests/e2e/example.spec.ts index a4bcdf8510..5a6d74ee52 100644 --- a/tests/e2e/example.spec.ts +++ b/tests/e2e/example.spec.ts @@ -39,7 +39,7 @@ test.beforeAll(async () => { test("起動したら「利用規約に関するお知らせ」が表示される", async () => { const app = await electron.launch({ args: ["."], - timeout: process.env.CI ? 0 : 180000, + timeout: process.env.CI ? 0 : 60000, env: { ...process.env, VITE_DEV_SERVER_URL: "http://localhost:5173", From 29f7108d33cb943933ccbe4ee80371e3eb3e84d1 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 22 Jul 2023 00:51:05 +0900 Subject: [PATCH 08/10] a --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b461df01b2..8c159e9515 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,8 @@ on: workflow_dispatch: env: - VOICEVOX_ENGINE_VERSION: 0.14.4 + VOICEVOX_ENGINE_REPO: "VOICEVOX/voicevox_nemo_engine" # 軽いのでNemoを使う + VOICEVOX_ENGINE_VERSION: "0.14.0" defaults: run: @@ -62,7 +63,7 @@ jobs: id: download-engine uses: ./.github/actions/download-engine with: - repo: VOICEVOX/voicevox_nemo_engine # 軽いのでNemoを使う + repo: ${{ env.VOICEVOX_ENGINE_REPO }} version: ${{ env.VOICEVOX_ENGINE_VERSION }} dest: ${{ github.workspace }}/voicevox_engine target: ${{ matrix.voicevox_engine_asset_name }} From b0ee985ce1953dc96d73b791e5ff97440c88a562 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 22 Jul 2023 01:14:26 +0900 Subject: [PATCH 09/10] =?UTF-8?q?=E5=AE=9F=E8=A1=8C=E6=A8=A9=E9=99=90?= =?UTF-8?q?=E3=82=92=E4=BB=98=E4=B8=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/download-engine/action.yml | 3 ++- .github/workflows/test.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/download-engine/action.yml b/.github/actions/download-engine/action.yml index f47830c17a..73d087bdc9 100644 --- a/.github/actions/download-engine/action.yml +++ b/.github/actions/download-engine/action.yml @@ -97,4 +97,5 @@ runs: else echo "run_path=$DEST/run" >> $GITHUB_OUTPUT fi - cat $TEMPDIR/target.json | jq -r '.tag_name' | sed -e 's_^_version=_' >> $GITHUB_OUTPUT + echo "version=$(jq -r '.tag_name' $TEMPDIR/target.json)" >> $GITHUB_OUTPUT + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8c159e9515..44e0ca036a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,6 +70,8 @@ jobs: - name: Run npm run test:e2e run: | + chmod +x ${{ steps.download-engine.outputs.run_path }} + cp .env.test .env sed -i -e 's|"../voicevox_engine/run.exe"|"${{ steps.download-engine.outputs.run_path }}"|' .env From e7364890a151a4ce8cb98fafc3766705efbcf76f Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 22 Jul 2023 01:45:43 +0900 Subject: [PATCH 10/10] a --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 44e0ca036a..5f2a77eef7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -57,7 +57,8 @@ jobs: if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update - sudo apt-get install -y xvfb x11-xserver-utils + sudo apt-get install -y xvfb x11-xserver-utils # for electron + sudo apt-get install -y libsndfile1 # for engine - name: Download VOICEVOX ENGINE id: download-engine