forked from VOICEVOX/voicevox
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (85 loc) · 2.69 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Test
on:
push:
pull_request:
branches:
- "**"
workflow_dispatch:
env:
VOICEVOX_ENGINE_REPO: "VOICEVOX/voicevox_nemo_engine" # 軽いのでNemoを使う
VOICEVOX_ENGINE_VERSION: "0.14.0"
defaults:
run:
shell: bash
jobs:
# ビルドのテスト
build-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup environment
uses: ./.github/actions/setup-environment
- run: npm run electron:build_pnever
# unit テスト
unit-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup environment
uses: ./.github/actions/setup-environment
- run: npm run test:unit
# electron の e2e テスト
e2e-test:
runs-on: ${{ matrix.os }}
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
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 # for electron
sudo apt-get install -y libsndfile1 # for engine
- name: Download VOICEVOX ENGINE
id: download-engine
uses: ./.github/actions/download-engine
with:
repo: ${{ env.VOICEVOX_ENGINE_REPO }}
version: ${{ env.VOICEVOX_ENGINE_VERSION }}
dest: ${{ github.workspace }}/voicevox_engine
target: ${{ matrix.voicevox_engine_asset_name }}
- 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
if [ -n "${{ runner.debug }}" ]; then
export DEBUG="pw:browser*"
fi
if [[ ${{ matrix.os }} == ubuntu-* ]]; then
xvfb-run --auto-servernum npm run test:e2e
else
npm run test:e2e
fi
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Disallowed licenses check
run: npm run license:generate -- -o voicevox_licenses.json
- run: npm run typecheck
- run: npm run lint
- run: npm run markdownlint