-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 1.91 KB
/
playwright.yml
File metadata and controls
65 lines (54 loc) · 1.91 KB
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
# Playwrightスモークテスト自動実行ワークフロー
# Playwright公式Dockerイメージを使用してブラウザとシステム依存関係のインストールを省略
name: Playwright Tests (Docker)
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pages: write
id-token: write
jobs:
test:
runs-on: ubuntu-latest
# Playwright公式Dockerイメージ: ブラウザとシステム依存関係がプリインストール済み
container:
image: mcr.microsoft.com/playwright:v1.55.1-noble
options: --user 1001
steps:
# Step 1: リポジトリのコードをチェックアウト
- uses: actions/checkout@v4
# Step 2: package.jsonに定義された依存関係をインストール
# Note: Dockerイメージに Node.js が含まれているため setup-node は不要
- name: Install dependencies
run: npm ci
# Step 3: Playwrightテストを実行
- name: Run Playwright tests
run: npm run test
# Step 4: publicディレクトリとテスト結果を統合
- name: Run Build for GitHub Pages
run: npm run build-for-pages
# Step 5: GitHub Pagesの設定
- name: Setup Pages
uses: actions/configure-pages@v5
if: always()
# Step 6: distディレクトリをアーティファクトとして保存
- uses: actions/upload-artifact@v4
if: always()
with:
name: dist
path: dist/
retention-days: 30
# Step 7: GitHub Pagesにアーティファクトをアップロード
- name: Upload Artifacts to GitHub Pages
uses: actions/upload-pages-artifact@v3
if: always()
with:
path: ./dist
# Step 8: GitHub Pagesにデプロイ
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: always()