feat: install husky and playwright from remix.init #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Vitest and Playwright | |
if: (github.event_name == 'pull_request') | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.node-version' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: get-npm-version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Run Vitest tests | |
run: npm run test:ci | |
env: | |
API_URL: ${{ secrets.API_URL }} | |
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
MSW_ENABLED: ${{ secrets.MSW_ENABLED }} | |
npm_package_version: ${{ steps.package-version.outputs.current-version}} | |
SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
SITE_URL: ${{ secrets.SITE_URL }} | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: npx playwright test | |
env: | |
API_URL: ${{ secrets.API_URL }} | |
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | |
MSW_ENABLED: ${{ secrets.MSW_ENABLED }} | |
npm_package_version: ${{ steps.package-version.outputs.current-version}} | |
SESSION_SECRET: ${{ secrets.SESSION_SECRET }} | |
SITE_URL: ${{ secrets.SITE_URL }} | |
- uses: actions/upload-artifact@v4 | |
if: ${{ failure() }} | |
name: Upload Playwright failed test traces | |
with: | |
name: playwright-traces | |
path: .playwright/output | |
retention-days: 5 | |