Skip to content

fix(lruMemoize): pass (cached, new) argument order to equalityCheck in LRU cache #1121

fix(lruMemoize): pass (cached, new) argument order to equalityCheck in LRU cache

fix(lruMemoize): pass (cached, new) argument order to equalityCheck in LRU cache #1121

name: CI
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
name: Build and Test on Node ${{ matrix.node }}
runs-on: ubuntu-latest
strategy:
matrix:
node: ['22.x']
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
# Read existing version, reuse that, add a Git short hash
- name: Set build version to Git commit
run: node scripts/writeGitVersion.mjs $(git rev-parse --short HEAD)
- name: Check updated version
run: jq .version package.json
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
- name: Pack
run: yarn pack
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: package
path: ./package.tgz
test-types:
name: Test Types with TypeScript ${{ matrix.ts }}
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['22.x']
ts: ['5.0', '5.1', '5.2', '5.3', '5.4', '5.5', '5.6', '5.7', '5.8']
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Install deps
run: yarn install --frozen-lockfile
# Build with the actual TS version in the repo
- name: Pack
run: yarn build && yarn pack
- name: Install build artifact
run: yarn add ./package.tgz
# Then install the specific version to test against
- name: Install TypeScript ${{ matrix.ts }}
run: yarn add --dev typescript@${{ matrix.ts }}
- name: 'Remove source to ensure packaged types are used'
run: rm -rf src
# Remove config line that points "reselect" to the `src` folder,
# so that the typetest will use the installed version instead
- run: sed -i -e /@remap-prod-remove-line/d ./typescript_test/tsconfig.json vitest.config.mts
- name: Test types
run: |
./node_modules/.bin/tsc --version
yarn test:typescript
are-the-types-wrong:
name: Check package config with are-the-types-wrong
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['22.x']
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: package
path: .
# Note: We currently expect "FalseCJS" failures for Node16 + `moduleResolution: "node16",
- name: Run are-the-types-wrong
run: npx @arethetypeswrong/cli@0.18.2 ./package.tgz --format table --ignore-rules false-cjs
test-published-artifact:
name: Test Published Artifact ${{ matrix.example }}
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['22.x']
example:
[
'cra4',
'cra5',
'next',
'vite',
'node-standard',
'node-esm',
'react-native',
'expo'
]
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- name: Clone RTK repo (pinned to known-good commit)
run: |
git init ./redux-toolkit
git -C ./redux-toolkit fetch --depth 1 https://github.com/reduxjs/redux-toolkit.git 576a02f8056fbee2dcaddb4d2e4d2da3b7937c58
git -C ./redux-toolkit checkout FETCH_HEAD
- name: Check folder contents
run: ls -l .
- name: Install example deps
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
env:
YARN_ENABLE_SCRIPTS: false
run: yarn install
- name: Install Playwright browser if necessary
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
continue-on-error: true
run: yarn playwright install || true
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: package
path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
- name: Check folder contents
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: ls -l .
- name: Install build artifact
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn add ./package.tgz
- name: Show installed package versions
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn info reselect && yarn why reselect
- name: Set up JDK 17 for React Native build
if: matrix.example == 'react-native'
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
with:
java-version: '17.x'
distribution: 'temurin'
- name: Check MSW version
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn why msw
- name: Build example
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
env:
NODE_OPTIONS: --openssl-legacy-provider
run: yarn build
- name: Run test step
working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}
run: yarn test