jwk.pages.dev/.github/workflows/test.yml
renovate[bot] fe45ed3c45
chore(deps): update actions/setup-node digest to 0a44ba7 (#66)
* chore(deps): update actions/setup-node digest to 0a44ba7

* fixed preview dns subdomain from branch ref

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Kohei Watanabe <nebel@fogtype.com>
2024-10-01 11:25:49 +09:00

40 lines
1.3 KiB
YAML

name: test
on:
pull_request:
workflow_run:
workflows: deploy
types: completed
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
timeout-minutes: 5
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- if: github.ref_name != github.event.repository.default_branch
id: set_preview_env
shell: bash
run: echo url="https://$(echo "${HEAD_REF:0:28}" | sed 's/[^_0-9a-z]/-/gi;s/-*$//').jwk.pages.dev/" >> "${GITHUB_OUTPUT}"
env:
HEAD_REF: ${{ github.head_ref }}
- name: Run tests on ${{ env.BASE_URL }}
run: npm test
env:
BASE_URL: ${{ github.ref_name == github.event.repository.default_branch && 'https://jwk.pages.dev/' || steps.set_preview_env.outputs.url }}
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
if: always()
with:
name: "playwright-report-${{ matrix.os }}"
path: playwright-report