Skip to content

Commit

Permalink
Add github workflow to run tests when code is merged to main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vasu31dev committed Mar 26, 2024
1 parent 4ffe337 commit f5aae69
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run Tests

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
test:
name: PR Check
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
# renovate: node-version
node-version: '18.19.1'

- name: Install Playwright Deps
run: npx playwright install-deps chromium

- name: Install Libraries
run: npm ci

- name: Run tests
run: npm test

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-test-results
path: playwright-report
# retention-days: 1
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"lint:fix": "cross-env eslint 'tests/**/*.ts' 'test-setup/**/*.ts' 'playwright.config.ts' '.eslintrc.js' --fix",
"format": "cross-env prettier --write 'tests/**/*.ts' 'test-setup/**/*.ts' 'playwright.config.ts' '.eslintrc.js' '**/*.json' '**/*.md' '!package-lock.json' '!dist/**/*' '!build/**/*'",
"prepare": "husky",
"postinstall": "playwright install"
"postinstall": "playwright install chromium"
},
"husky": {
"hooks": {
Expand Down

0 comments on commit f5aae69

Please sign in to comment.