Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add vitest coverage #175

Merged
merged 6 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
node-version: [16.x, 20.x]
zustand: [latest, 4.2.0, 4.0.0, 5.0.0-alpha.6]
zustand: [latest, 4.2.0, 4.0.0, next]

steps:
- uses: actions/checkout@v4
Expand All @@ -20,27 +20,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: latest
version: 8
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-${{ matrix.node-version }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}-pnpm-store-

- name: Install Dependencies
run: pnpm install

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Test'
on:
pull_request:

jobs:
test:
runs-on: ubuntu-latest

permissions:
# Required to checkout the code
contents: read
# Required to put a comment into the pull-request
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 8
run_install: false
- name: Install Node
uses: actions/setup-node@v4
- name: Install Deps
run: pnpm install
- name: Test
run: pnpm test
- name: Report Coverage
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
uses: davelosert/vitest-coverage-report-action@v2
with:
working-directory: ./tests
14 changes: 7 additions & 7 deletions examples/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
"lodash.merge": "4.6.2",
"lodash.throttle": "4.1.1",
"microdiff": "1.4.0",
"next": "14.1.4",
"react": "18.2.0",
"react-dom": "18.2.0",
"next": "14.2.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"zundo": "workspace:*",
"zustand": "4.5.2"
},
"devDependencies": {
"@types/lodash.merge": "4.6.9",
"@types/lodash.throttle": "4.1.9",
"@types/node": "20.12.5",
"@types/react": "18.2.74",
"eslint": "9.0.0",
"typescript": "5.4.4"
"@types/node": "20.13.0",
"@types/react": "18.3.3",
"eslint": "9.4.0",
"typescript": "5.4.5"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"prettier": "3.2.5",
"tsup": "8.0.2",
"typescript": "5.4.4",
"typescript": "5.4.5",
"zustand": "4.5.2"
},
"peerDependencies": {
Expand Down
Loading