From dae2fa0849f75b1abb99ee4603f0f8500444da4e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 14:47:18 +0000 Subject: [PATCH 1/3] ci: add website ja/en integration test workflow with playwright Agent-Logs-Url: https://github.com/sensuikan1973/pedax/sessions/b671752b-d862-42eb-991d-dd43c6931560 Co-authored-by: sensuikan1973 <23427957+sensuikan1973@users.noreply.github.com> --- .../workflows/website_integration_test.yaml | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/website_integration_test.yaml diff --git a/.github/workflows/website_integration_test.yaml b/.github/workflows/website_integration_test.yaml new file mode 100644 index 000000000..cd8a6671f --- /dev/null +++ b/.github/workflows/website_integration_test.yaml @@ -0,0 +1,84 @@ +--- +name: Website Integration Test + +on: + pull_request: + paths: + - '.github/workflows/website_integration_test.yaml' + - 'website/**' + push: + branches: [main] + paths: + - '.github/workflows/website_integration_test.yaml' + - 'website/**' + workflow_dispatch: + +jobs: + website_integration_test: + runs-on: ubuntu-latest + timeout-minutes: 15 + defaults: + run: + working-directory: website + + steps: + - uses: actions/checkout@v6 + + # https://github.com/actions/setup-node/issues/206#issuecomment-774538395 + - uses: nodenv/actions/node-version@main + id: nodenv + - uses: actions/setup-node@v6 + with: + node-version: '${{ steps.nodenv.outputs.node-version }}' + + - run: yarn install --frozen-lockfile + - run: yarn build + + - name: Verify JA/EN website pages with Playwright + run: | + yarn serve --port 3000 --host 127.0.0.1 >"$RUNNER_TEMP/docusaurus-serve.log" 2>&1 & + + started=false + for i in {1..60}; do + if curl -fsS "http://127.0.0.1:3000/pedax/" >/dev/null && \ + curl -fsS "http://127.0.0.1:3000/pedax/en/" >/dev/null; then + started=true + break + fi + sleep 1 + done + + if [ "$started" != "true" ]; then + cat "$RUNNER_TEMP/docusaurus-serve.log" + echo "Docusaurus server failed to start" + exit 1 + fi + + mkdir -p "$RUNNER_TEMP/playwright" + cat <<'EOF' >"$RUNNER_TEMP/playwright/package.json" + { + "name": "website-integration-test", + "private": true + } + EOF + + cat <<'EOF' >"$RUNNER_TEMP/playwright/website.integration.spec.js" + const { test, expect } = require('@playwright/test') + + test('ja locale page is displayed', async ({ page }) => { + const response = await page.goto('http://127.0.0.1:3000/pedax/') + expect(response.ok()).toBeTruthy() + await expect(page.getByText('edax 用のリバーシ盤')).toBeVisible() + }) + + test('en locale page is displayed', async ({ page }) => { + const response = await page.goto('http://127.0.0.1:3000/pedax/en/') + expect(response.ok()).toBeTruthy() + await expect(page.getByText('Reversi Board with edax')).toBeVisible() + }) + EOF + + cd "$RUNNER_TEMP/playwright" + npm install --no-fund --no-audit @playwright/test + npx playwright install chromium + npx playwright test website.integration.spec.js --reporter=line From a9bc0890d6cdc1efcb67206745750bb01adbd7f9 Mon Sep 17 00:00:00 2001 From: sensuikan1973 <23427957+sensuikan1973@users.noreply.github.com> Date: Mon, 4 May 2026 23:51:37 +0900 Subject: [PATCH 2/3] Update labeler.yml --- .github/labeler.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index dfa40c8a6..0fc8ce352 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -21,6 +21,7 @@ windows: website: - changed-files: - any-glob-to-any-file: website/**/* + - any-glob-to-any-file: .github/workflows/website_integration_test.yaml libedax: - changed-files: From 800715d8ba72e46dc98977008f029876703ddde7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 4 May 2026 14:59:22 +0000 Subject: [PATCH 3/3] ci: upload ja/en page screenshots as website test artifacts Agent-Logs-Url: https://github.com/sensuikan1973/pedax/sessions/d3b24a0c-0c7f-4f12-95a2-ef116bd57001 Co-authored-by: sensuikan1973 <23427957+sensuikan1973@users.noreply.github.com> --- .github/workflows/website_integration_test.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/website_integration_test.yaml b/.github/workflows/website_integration_test.yaml index cd8a6671f..94c64df82 100644 --- a/.github/workflows/website_integration_test.yaml +++ b/.github/workflows/website_integration_test.yaml @@ -55,6 +55,7 @@ jobs: fi mkdir -p "$RUNNER_TEMP/playwright" + mkdir -p "$RUNNER_TEMP/playwright/screenshots" cat <<'EOF' >"$RUNNER_TEMP/playwright/package.json" { "name": "website-integration-test", @@ -64,21 +65,33 @@ jobs: cat <<'EOF' >"$RUNNER_TEMP/playwright/website.integration.spec.js" const { test, expect } = require('@playwright/test') + const path = require('path') + const screenshotDir = process.env.SCREENSHOT_DIR test('ja locale page is displayed', async ({ page }) => { const response = await page.goto('http://127.0.0.1:3000/pedax/') expect(response.ok()).toBeTruthy() await expect(page.getByText('edax 用のリバーシ盤')).toBeVisible() + await page.screenshot({ path: path.join(screenshotDir, 'ja-page.png'), fullPage: true }) }) test('en locale page is displayed', async ({ page }) => { const response = await page.goto('http://127.0.0.1:3000/pedax/en/') expect(response.ok()).toBeTruthy() await expect(page.getByText('Reversi Board with edax')).toBeVisible() + await page.screenshot({ path: path.join(screenshotDir, 'en-page.png'), fullPage: true }) }) EOF cd "$RUNNER_TEMP/playwright" npm install --no-fund --no-audit @playwright/test npx playwright install chromium - npx playwright test website.integration.spec.js --reporter=line + SCREENSHOT_DIR="$RUNNER_TEMP/playwright/screenshots" npx playwright test website.integration.spec.js --reporter=line + + - name: Upload website locale screenshots + if: always() + uses: actions/upload-artifact@v4 + with: + name: website-integration-screenshots + path: ${{ runner.temp }}/playwright/screenshots + if-no-files-found: warn