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 Test Matrix #168

Merged
merged 14 commits into from
Mar 10, 2024
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
zustand: [latest, 4.2.0, 4.0.0, 5.0.0-alpha.5]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v3
name: Install pnpm
id: pnpm-install
with:
Expand All @@ -32,7 +33,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
Expand All @@ -43,6 +44,15 @@ jobs:
- name: Install Dependencies
run: pnpm install

- name: Install Zustand ${{ matrix.zustand }}
run: pnpm add zustand@${{ matrix.zustand }} -w

- name: Patch tsup config
if: ${{ matrix.zustand == '4.0.0' }}
# Patch the tsup config to use `dts: false` for Zustand 4.0.0
run: |
sed -i~ 's/dts: true/dts: false/' tsup.config.ts

- name: Build
run: pnpm run build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Try a live [demo](https://codesandbox.io/s/currying-flower-2dom9?file=/src/App.t
npm i zustand zundo
```

> zustand v4.3.0 or higher is required for TS usage. v4.0.0 or higher is required for JS usage.
> zustand v4.2.0 or higher is required for TS usage. v4.0.0 or higher is required for JS usage. zundo v2 works with zustand v5.0.0 or higher.
> Node 16 or higher is required.

## Background
Expand Down