diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..ad459fe --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,41 @@ +name: PR CI + +on: + pull_request: + types: [opened, synchronize, reopened] + paths-ignore: + - README.md + - LICENSE + - .gitignore + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - run: npm i + - run: npm run check:all + + build: + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - run: npm i + - run: npm run build + + test: + runs-on: ubuntu-latest + timeout-minutes: 3 + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + + - run: npm i + - run: npx playwright install + - run: npm run test diff --git a/.gitignore b/.gitignore index 4aefd08..8862539 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,8 @@ node_modules .idea dist adyen-document-viewer.iml -package-lock.json \ No newline at end of file +package-lock.json + +# Playwright +test-results/ +playwright-report/ \ No newline at end of file diff --git a/package.json b/package.json index d86ef34..5331c14 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "viewer", "adyen-document-viewer" ], - "version": "1.1.2", + "version": "1.1.3", "description": "Adyen Document Viewer", "main": "./dist/adyen-document-viewer.min.js", "module": "./dist/adyen-document-viewer.min.mjs", @@ -16,13 +16,17 @@ "scripts": { "start": "vite", "build": "vite build && npm run types:build", + "check:all": "npm run types:check && npm run lint && npm run prettier", "lint": "eslint 'src/**/*.{js,ts,tsx}'", "lint:fix": "npm run lint -- --fix", "prettier": "prettier --config ./prettier.config.js --ignore-unknown --check \"**/*\"", "prettier:fix": "prettier --config ./prettier.config.js --ignore-unknown --write \"**/*\"", "fix:all": "npm run prettier:fix && npm run lint:fix", + "test": "playwright test", + "test:debug": "playwright test --debug", + "test:ui": "playwright test --ui", "types:build": "tsc --project tsconfig-build.json", - "types:check": "tsc && tsc-strict", + "types:check": "tsc", "types:watch": "tsc --watch --preserveWatchOutput" }, "dependencies": { @@ -30,6 +34,7 @@ "preact": "10.19.3" }, "devDependencies": { + "@playwright/test": "^1.45.3", "@preact/preset-vite": "^2.8.1", "@typescript-eslint/eslint-plugin": "^6.19.1", "@typescript-eslint/parser": "^6.19.1", @@ -48,7 +53,6 @@ "stylelint-config-sass-guidelines": "^9.0.1", "stylelint-scss": "^4.2.0", "typescript": "^5.3.3", - "typescript-strict-plugin": "^2.2.0", "vite": "^4.5.1" }, "license": "MIT", diff --git a/index.html b/playground/index.html similarity index 79% rename from index.html rename to playground/index.html index 169f6f1..c4b18b7 100644 --- a/index.html +++ b/playground/index.html @@ -7,6 +7,7 @@
- + +