Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c804bc8

Browse files
split a github action into 2 (#18)
1 parent a0d691f commit c804bc8

File tree

4 files changed

+183
-32
lines changed

4 files changed

+183
-32
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
# This is a basic workflow to help you get started with Actions
3+
4+
name: Playwright tests
5+
6+
# Controls when the workflow will run
7+
on:
8+
# Triggers the workflow on push or pull request events but only for the "main" branch
9+
push:
10+
branches: [ "main" ]
11+
pull_request:
12+
branches: [ "main" ]
13+
schedule:
14+
# nightly
15+
- cron: '0 0 * * *'
16+
17+
# Allows you to run this workflow manually from the Actions tab
18+
workflow_dispatch:
19+
20+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
21+
jobs:
22+
test:
23+
# Runs on an ubuntu runner
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
matrix:
28+
node-version: [14.x, 16.x, 18.x]
29+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
- name: Install dependencies
35+
run: npm ci
36+
- name: Install Playwright
37+
run: npx playwright install --with-deps
38+
- name: Build production build
39+
run: npm run build
40+
- name: Run your tests
41+
run: npm run playwright_test
42+
- name: Get current date
43+
id: date
44+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
45+
- name: Upload HTML report as Artifact
46+
uses: actions/upload-artifact@v2
47+
env:
48+
TAG_NAME: test-report-${{ steps.date.outputs.date }}
49+
if: always()
50+
with:
51+
name: onDemand
52+
path: pw-report/
53+
54+
storeReports:
55+
name: Store reports
56+
if: ${{ always() }}
57+
needs: test
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Download all workflow run artifacts
61+
uses: actions/download-artifact@v3
62+
id: download
63+
- name: Publish to external repo
64+
if: always()
65+
uses: peaceiris/actions-gh-pages@v3.7.3
66+
with:
67+
external_repository: mspnp/intern-js-pipeline
68+
publish_branch: gh-pages
69+
personal_token: ${{ secrets.PAT_TOKEN }}
70+
publish_dir: ${{steps.download.outputs.download-path}}
71+
destination_dir: test-reports/${{ github.repository }}
72+
keep_files: true
73+
user_name: "github-actions[bot]"
74+
user_email: "github-actions[bot]@users.noreply.github.com"
75+
76+
notify-dashboard:
77+
name: Notify Dashboard
78+
if: ${{ always() }}
79+
needs: [test, storeReports]
80+
# The type of runner that the job will run on
81+
runs-on: ubuntu-latest
82+
83+
# Steps represent a sequence of tasks that will be executed as part of the job
84+
steps:
85+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
86+
- uses: actions/checkout@v3
87+
88+
# Runs a single command using the runners shell
89+
- name: Notify docusaurus repo
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
92+
run: |
93+
gh api repos/mspnp/intern-js-pipeline/dispatches \
94+
--raw-field event_type=rebuild-site
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Scheduled Playwright tests
2+
3+
# Controls when the workflow will run
4+
on:
5+
# Triggers the workflow nightly
6+
schedule:
7+
# nightly
8+
- cron: '0 0 * * *'
9+
10+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
11+
jobs:
12+
test:
13+
# Runs on an ubuntu runner
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
node-version: [14.x, 16.x, 18.x]
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-node@v3
24+
- name: Install dependencies
25+
run: npm ci
26+
- name: Install Playwright
27+
run: npx playwright install --with-deps
28+
- name: Build production build
29+
run: npm run build
30+
- name: Run your tests
31+
run: npm run playwright_test
32+
- name: Get current date
33+
id: date
34+
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
35+
- name: Upload HTML report as Artifact
36+
uses: actions/upload-artifact@v2
37+
env:
38+
TAG_NAME: test-report-${{ steps.date.outputs.date }}
39+
if: always()
40+
with:
41+
name: ${{ steps.date.outputs.date }}
42+
path: pw-report/
43+
44+
storeReports:
45+
name: Store reports
46+
if: ${{ always() }}
47+
needs: test
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Download all workflow run artifacts
51+
uses: actions/download-artifact@v3
52+
id: download
53+
- name: Publish to external repo
54+
if: always()
55+
uses: peaceiris/actions-gh-pages@v3.7.3
56+
with:
57+
external_repository: mspnp/intern-js-pipeline
58+
publish_branch: gh-pages
59+
personal_token: ${{ secrets.PAT_TOKEN }}
60+
publish_dir: ${{steps.download.outputs.download-path}}
61+
destination_dir: test-reports/${{ github.repository }}
62+
keep_files: true
63+
user_name: "github-actions[bot]"
64+
user_email: "github-actions[bot]@users.noreply.github.com"
65+
66+
notify-dashboard:
67+
name: Notify Dashboard
68+
if: ${{ always() }}
69+
needs: [test, storeReports]
70+
# The type of runner that the job will run on
71+
runs-on: ubuntu-latest
72+
73+
# Steps represent a sequence of tasks that will be executed as part of the job
74+
steps:
75+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
76+
- uses: actions/checkout@v3
77+
78+
# Runs a single command using the runners shell
79+
- name: Notify dashboard repo
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
82+
run: |
83+
gh api repos/mspnp/intern-js-pipeline/dispatches \
84+
--raw-field event_type=rebuild-site

‎.github/workflows/playwright.yml‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎playwright.config.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PlaywrightTestConfig } from '@playwright/test';
22
const config: PlaywrightTestConfig = {
33
use: {
4+
trace: 'on',
45
baseURL: "http://localhost:3000/"
56
},
67
webServer: {
@@ -9,5 +10,9 @@ const config: PlaywrightTestConfig = {
910
timeout: 120 * 1000,
1011
reuseExistingServer: !process.env.CI,
1112
},
13+
reporter: [
14+
['html', { outputFolder: 'pw-report' }],
15+
['json', { outputFolder: 'pw-report', outputFile: 'report.json' }]
16+
],
1217
};
1318
export default config;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /