From bbd8ee6b2f0065c870ee0957bf6008a33908bf5a Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 21 Feb 2024 20:18:46 -0600 Subject: [PATCH 1/6] Add React Native and Expo to examples in CI --- .github/workflows/test.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c6ca77..c8f5aba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,7 +89,17 @@ jobs: fail-fast: false matrix: node: ['16.x'] - example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm'] + example: + [ + 'cra4', + 'cra5', + 'next', + 'vite', + 'node-standard', + 'node-esm', + 'react-native', + 'expo', + ] steps: - name: Checkout repo uses: actions/checkout@v2 From ea5f9edae18a633233fa244ce7d0419853a5cef3 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 21 Feb 2024 20:19:11 -0600 Subject: [PATCH 2/6] Add `YARN_ENABLE_IMMUTABLE_INSTALLS: false` to CI --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c8f5aba..3a14504 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -118,6 +118,8 @@ jobs: - name: Install deps working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false run: yarn install - uses: actions/download-artifact@v2 From 7ea68b8a45935c8baf3f8d26949e85ead0f56bba Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 21 Feb 2024 20:19:41 -0600 Subject: [PATCH 3/6] Setup JDK for React Native --- .github/workflows/test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a14504..50ae54f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -139,6 +139,13 @@ jobs: working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} run: yarn info redux-thunk && yarn why redux-thunk + - name: Set up JDK 17 for React Native build + if: matrix.example == 'react-native' + uses: actions/setup-java@v4 + with: + java-version: '17.x' + distribution: 'temurin' + - name: Build example working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} run: yarn build From 8af937ee7e6824dc4c8d6ea7a6c9b355580b34d2 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 21 Feb 2024 20:19:58 -0600 Subject: [PATCH 4/6] Add `NODE_OPTIONS: --openssl-legacy-provider` to CI --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 50ae54f..5c6f458 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -148,6 +148,8 @@ jobs: - 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 From b8ea7e962be68e464345fc8969c59f74e50f8155 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Mon, 11 Mar 2024 12:58:08 -0500 Subject: [PATCH 5/6] Run Prettier on all files --- .github/workflows/test.yml | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1fe6fb..b69802e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,7 +98,7 @@ jobs: 'node-standard', 'node-esm', 'react-native', - 'expo', + 'expo' ] steps: - name: Checkout repo diff --git a/tsconfig.json b/tsconfig.json index 4395c6d..88686c9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ "forceConsistentCasingInFileNames": true, "experimentalDecorators": true, "rootDirs": ["./src", "./test"], - "types": ["vitest/globals"], + "types": ["vitest/globals"], "baseUrl": ".", "paths": { "redux-thunk": ["src/index.ts"], // @remap-prod-remove-line From 1df805887b9bc537cdf024707ff14d8d2734cbbc Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Mon, 11 Mar 2024 13:06:32 -0500 Subject: [PATCH 6/6] Add a cache for example deps --- .github/workflows/test.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b69802e..f6aa63e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -113,6 +113,12 @@ jobs: - name: Clone RTK repo run: git clone https://github.com/reduxjs/redux-toolkit.git ./redux-toolkit + - name: Cache example deps + uses: actions/cache@v4 + with: + path: ./redux-toolkit/examples/publish-ci/${{ matrix.example }}/node_modules + key: test-published-artifact-${{ matrix.example }}-node_modules + - name: Check folder contents run: ls -l . @@ -139,13 +145,6 @@ jobs: working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} run: yarn info redux-thunk && yarn why redux-thunk - - name: Set up JDK 17 for React Native build - if: matrix.example == 'react-native' - uses: actions/setup-java@v4 - with: - java-version: '17.x' - distribution: 'temurin' - - name: Build example working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} env: