diff --git a/.github/workflows/emoji-support.yml b/.github/workflows/emoji-support.yml index aefaf76..9de9a88 100644 --- a/.github/workflows/emoji-support.yml +++ b/.github/workflows/emoji-support.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - browser: [chromium, firefox, webkit] + browser: [chromium, chrome, firefox, webkit] runs-on: ${{ matrix.os }} defaults: run: @@ -26,7 +26,12 @@ jobs: with: node-version: 24 - run: npm install - - run: npx playwright install --with-deps ${{ matrix.browser }} + - if: matrix.browser != 'chrome' + run: npx playwright install --with-deps ${{ matrix.browser }} + # Google Chrome はランナーにプリインストールされたものを使う。 + # Linux だけは他ブラウザーと条件を揃えるため依存パッケージ (フォント含む) を入れる。 + - if: matrix.browser == 'chrome' && runner.os == 'Linux' + run: npx playwright install-deps chromium - run: npm run fetch - name: Linux のフォント構成を記録 if: runner.os == 'Linux' diff --git a/emoji-support/check.mjs b/emoji-support/check.mjs index 45aed65..f445330 100644 --- a/emoji-support/check.mjs +++ b/emoji-support/check.mjs @@ -38,8 +38,11 @@ for (const line of text.split("\n")) { } } -const browserType = { chromium, firefox, webkit }[browserName]; -const browser = await browserType.launch(); +// chrome は環境にインストール済みの Google Chrome (stable) を使う +const browserType = { chromium, chrome: chromium, firefox, webkit }[browserName]; +const browser = await browserType.launch( + browserName === "chrome" ? { channel: "chrome" } : {}, +); const page = await browser.newPage({ viewport: { width: 1280, height: 800 } }); await page.setContent( `emoji`,