Skip to content

Commit

Permalink
ci: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasskk committed Sep 17, 2022
1 parent 2a9152e commit 601aa5f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/tests_admin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- uses: pnpm/action-setup@v2.0.1
name: Install pnpm
with:
version: latest

- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
- name: Install dependencies
run: pnpm install

- name: unit test
run: pnpm --filter react-pocket-form test:unit

- name: cypress test
run: pnpm --filter react-pocket-form run test:cypress
2 changes: 1 addition & 1 deletion packages/react-pocket-form/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
viewportWidth: 1000,
viewportHeight: 1000,
video: true,
video: false,
env: {
reactDevtools: true,
},
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion packages/react-pocket-form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
}
},
"scripts": {
"test": "vitest",
"test:unit": "vitest run",
"test:cypress": "cypress run --component",
"clean": "rm -rf dist lib",
"build": "pnpm clean && pnpm tsc -p tsconfig.build.json --outDir dist & pnpm tsc -p tsconfig.build.json --emitDeclarationOnly && pnpm rollup -c",
"release": "pnpm build && npm publish"
Expand Down

0 comments on commit 601aa5f

Please sign in to comment.