Skip to content

Commit

Permalink
test: gh action for all Code Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVidra committed Jan 18, 2024
1 parent 78dee9b commit 9ac0d1e
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 13 deletions.
55 changes: 47 additions & 8 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,63 @@
name: Playwright Tests
name: Code Checks
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
jobs:
test:
tsc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm tsc

jest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm lint

playwright:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Build dist files
run: pnpm run build
- name: Run Playwright tests
run: pnpm playwright:docker
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm run build
- run: pnpm playwright:docker
- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm pre-push
7 changes: 4 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: "ts-jest",
testEnvironment: "node",
testPathIgnorePatterns: ["<rootDir>/tests/"],
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
"release": "pnpm build && pnpm publish --access=public --no-git-checks",
"test": "jest",
"test:watch": "jest --watch",
"tsc": "tsc -p tsconfig.lib.json",
"tsc": "tsc -p tsconfig.json",
"playwright": "playwright test",
"playwright:docker": "./docker_run_playwright.sh",
"serve:test": "vite"
"serve:test": "vite",
"pre-push": "concurrently \"pnpm lint\" \"pnpm test\" \"pnpm tsc\""
},
"dependencies": {
"@floating-ui/dom": "^1.5.3",
Expand Down

0 comments on commit 9ac0d1e

Please sign in to comment.