Skip to content

Merge pull request #33 from futabooo/renovate/daisyui-4.x-lockfile #28

Merge pull request #33 from futabooo/renovate/daisyui-4.x-lockfile

Merge pull request #33 from futabooo/renovate/daisyui-4.x-lockfile #28

name: Playwright Test
on:
push:
branches: main
pull_request:
branches: main
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: .tool-versions
- name: Install dependencies
run: npm ci
- name: Build project
shell: bash
run: npm run build
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- name: Deploy Playwright tests report
id: deploy
if: ${{ !cancelled() }}
uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy playwright-report --project-name=notion-bar-colorize
- name: Comment on PR with deployment URL
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
DEPLOYMENT_URL: ${{ steps.deploy.outputs.deployment-url }}
run: |
comment_body="Playwright tests report deployed to ${DEPLOYMENT_URL}"
# workaround https://github.com/cli/cli/issues/6790
gh pr comment "${PR_NUMBER}" --body "$comment_body" --edit-last || \
gh pr comment "${PR_NUMBER}" --body "$comment_body"