Skip to content

Commit

Permalink
テスト動かしてみる
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Jun 27, 2024
1 parent 53d4cbe commit 8a3ffb7
Show file tree
Hide file tree
Showing 8 changed files with 11,032 additions and 7,503 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Chromaticにmainブランチをpushする
# お試し運用中なので消滅する可能性あり

# TODO: Enable TurboSnap
# https://www.chromatic.com/docs/github-actions/#enable-turbosnap

name: "Chromatic"

on:
push:
branches:
- main

jobs:
chromatic:
name: Run Chromatic
runs-on: ubuntu-latest
if: github.repository_owner == 'VOICEVOX'
steps:
- uses: actions/checkout@v4
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Run Chromatic
uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
exitZeroOnChanges: true
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,29 @@ jobs:

- run: npm run test:unit

- name: Setup playwright
run: npx playwright install
- name: Run Storybook tests
run: |
# ランダムなポートを使う
PORT=$(node -r net -e "server=net.createServer();server.listen(0,()=>{console.log(server.address().port);server.close()})")
npx storybook dev --ci --port $PORT &
# 起動を待つ
elapsed=0
until curl --output /dev/null --silent --head --fail http://localhost:$PORT; do
echo "Waiting for Storybook to start on port $PORT..."
sleep 5
((elapsed+=5))
if [ "$elapsed" -ge "60" ]; then
echo "Timed out waiting for Storybook to start."
exit 1
fi
done
# テスト
npm run test:storybook -- --port $PORT
# e2e テスト
e2e-test:
runs-on: ${{ matrix.os }}
Expand All @@ -71,7 +94,7 @@ jobs:
voicevox_engine_asset_name: linux-cpu
- os: macos-latest
voicevox_engine_asset_name: macos-x64
# TODO: voicevox_nemo_negineがarm64に対応したら変更する
# TODO: voicevox_nemo_negineがarm64に対応したら変更する
# - os: macos-latest
# voicevox_engine_asset_name: macos-arm64
- os: windows-latest
Expand Down
5 changes: 5 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ setup((app) => {

const preview: Preview = {
tags: ['autodocs'],

Check failure on line 35 in .storybook/preview.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `'autodocs'` with `"autodocs"`
parameters: {
docs: {
toc: true,
},
},
argTypesEnhancers: [

Check failure on line 41 in .storybook/preview.ts

View workflow job for this annotation

GitHub Actions / lint

Replace `⏎····addActionsWithEmits,⏎··` with `addActionsWithEmits`
addActionsWithEmits,
],
Expand Down
Loading

0 comments on commit 8a3ffb7

Please sign in to comment.