jwk.pages.dev/.github/workflows/test.yml
renovate[bot] 974a9698a7
chore(deps): update actions/upload-artifact digest to 6f51ac0 (#75)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-01 04:31:42 +00: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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # 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@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
if: always()
with:
name: "playwright-report-${{ matrix.os }}"
path: playwright-report