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

vitest -> bun #39

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: deploy

# check
on:
push:
pull_request:
branches:
- main
# on:
# push:
# branches:
# - main

jobs:
deployment:
Expand All @@ -23,7 +28,7 @@ jobs:
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
path: "**/node_modules"
key: ${{ runner.os }}-build-cache-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-build-cache-bun-
Expand Down Expand Up @@ -54,18 +59,18 @@ jobs:
channelId: live
projectId: one-pager-maker
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: bun playwright install --with-deps
- name: Run Playwright tests
run: npm run e2e:all
run: bun run e2e:all
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Test Failure
uses: rjstone/discord-webhook-notify@v1
if: failure() || cancelled()
with:
details: Test Failed!
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
# - name: Test Failure
# uses: rjstone/discord-webhook-notify@v1
# if: failure() || cancelled()
# with:
# details: Test Failed!
# webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
26 changes: 13 additions & 13 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: integration-test

# check
on:
push:
pull_request:
branches:
- main
# schedule:
# # everyday 00:00 JST
# - cron: '0 15 * * *'
# on:
# push:
# branches:
# - main

jobs:
run-integration-test:
Expand All @@ -21,8 +23,6 @@ jobs:
run: npm install -g firebase-tools
- name: bun install
run: bun install
- name: install vitest global # これをしないと vitest コマンドが firebase exec から実行できない
run: bun i -g vitest
- name: Create .env file
shell: bash
run: |
Expand All @@ -36,10 +36,10 @@ jobs:
echo "VITE_MEASUREMENT_ID=${{ secrets.VITE_MEASUREMENT_ID }}" >> .env
- name: test
run: bun run test-integration
- name: Test Failure
uses: rjstone/discord-webhook-notify@v1
if: failure() || cancelled()
with:
severity: error
details: Failed! [URL](${{ github.event.pull_request.html_url }})
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
# - name: Test Failure
# uses: rjstone/discord-webhook-notify@v1
# if: failure() || cancelled()
# with:
# severity: error
# details: Failed! [URL](${{ github.event.pull_request.html_url }})
# webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
Binary file modified one-pager-maker/bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions one-pager-maker/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
preload = "./happydom.ts"
5 changes: 5 additions & 0 deletions one-pager-maker/happydom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { GlobalRegistrator } from "@happy-dom/global-registrator";

const bunFetch = fetch;
GlobalRegistrator.register();
window.fetch = bunFetch;
Loading
Loading