Skip to content

Commit

Permalink
update husky scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlinco committed Nov 8, 2023
1 parent 4e47e7f commit 7a68a82
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run Playwright Tests
on:
pull_request:
branches:
- master

jobs:
test_setup:
name: Test Setup
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel preview deployment to be ready
uses: patrickedqvist/[email protected]
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 300
test_e2e:
needs: test_setup
name: Playwright tests
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Prepare testing env
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm ci
- run: npx playwright install --with-deps
- name: Run tests
run: npm run test:e2e
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.test_setup.outputs.preview_url }}
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint && npx lint-staged --concurrent false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"eslint": "^8",
"eslint-config-next": "14.0.1",
"eslint-config-prettier": "^9.0.0",
"husky": "^8.0.3",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"postcss": "^8",
"prettier": "^3.0.3",
Expand Down

0 comments on commit 7a68a82

Please sign in to comment.