mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
* Update rollup config in order to drop system js and umd builds * Update packages * Clean up files * Update rollup config * Update gh workflows * Minor fixes * Minor fixes * Minor fixes * Minor fixes * Testing * Minor changes * Minor fixes
52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
name: Test Multiple Builds
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
|
|
jobs:
|
|
test_matrix:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
build: [cjs, esm]
|
|
env: [development] # [development, production]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18'
|
|
cache: yarn
|
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
- run: yarn install --frozen-lockfile --check-files
|
|
- run: yarn build
|
|
- name: Patch for DEV-ONLY
|
|
if: ${{ matrix.env == 'development' }}
|
|
run: |
|
|
sed -i~ "s/it[.a-zA-Z]*('\[DEV-ONLY\]/it('/" tests/*.tsx
|
|
sed -i~ "s/it[.a-zA-Z]*('\[PRD-ONLY\]/it.skip('/" tests/*.tsx
|
|
- name: Patch for PRD-ONLY
|
|
if: ${{ matrix.env == 'production' }}
|
|
run: |
|
|
sed -i~ "s/it[.a-zA-Z]*('\[PRD-ONLY\]/it('/" tests/*.tsx
|
|
sed -i~ "s/it[.a-zA-Z]*('\[DEV-ONLY\]/it.skip('/" tests/*.tsx
|
|
- name: Patch for CJS
|
|
if: ${{ matrix.build == 'cjs' }}
|
|
run: |
|
|
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\1.js/" package.json
|
|
- name: Patch for ESM
|
|
if: ${{ matrix.build == 'esm' }}
|
|
run: |
|
|
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/esm\1.js/" package.json
|
|
sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx
|
|
env:
|
|
NODE_ENV: ${{ matrix.env }}
|
|
- name: Test ${{ matrix.build }} ${{ matrix.env }}
|
|
run: |
|
|
yarn test:ci
|
|
env:
|
|
NODE_ENV: ${{ matrix.env }}
|