11name : CI
22on : [push, pull_request]
3+ defaults :
4+ run :
5+ working-directory : ./packages/toolkit
6+
37jobs :
48 build :
59 name : Lint, Test, Build & Pack on Node ${{ matrix.node }}
@@ -18,21 +22,22 @@ jobs:
1822 with :
1923 node-version : ${{ matrix.node }}
2024
21- - uses : c-hive/gha-npm-cache@v1
25+ - uses : actions/cache@v2
26+ with :
27+ path : .yarn/cache
28+ key : yarn-${{ hashFiles('yarn.lock') }}
29+ restore-keys : yarn-
2230
2331 - name : Install deps
24- run : npm ci
25-
26- - name : Build
27- run : npm run build-ci
32+ run : yarn install
2833
2934 - name : Pack
30- run : npm pack
35+ run : yarn pack
3136
3237 - uses : actions/upload-artifact@v2
3338 with :
3439 name : package
35- path : reduxjs- toolkit* .tgz
40+ path : packages/ toolkit/package .tgz
3641
3742 test-dist :
3843 name : Test against dist
@@ -51,23 +56,29 @@ jobs:
5156 with :
5257 node-version : ${{ matrix.node }}
5358
54- - uses : c-hive/gha-npm-cache@v1
59+ - uses : actions/cache@v2
60+ with :
61+ path : .yarn/cache
62+ key : yarn-${{ hashFiles('yarn.lock') }}
63+ restore-keys : yarn-
5564
5665 - name : Install deps
57- run : npm ci --ignore-scripts
66+ run : yarn install
5867
5968 - uses : actions/download-artifact@v2
6069 with :
6170 name : package
71+ path : packages/toolkit
72+
73+ - run : ls -lah
6274
6375 - name : Install build artifact
64- run : |
65- sed -i -e '/"name": "@reduxjs\/toolkit",/d' package.json
66- npm i reduxjs-toolkit-*.tgz --ignore-scripts
67- sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./jest.config.js ./src/tests/*.* ./src/query/tests/*.*
76+ run : yarn workspace @reduxjs/toolkit add $(pwd)/package.tgz
77+
78+ - run : sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./jest.config.js ./src/tests/*.* ./src/query/tests/*.*
6879
6980 - name : Run tests, against dist
70- run : npm test
81+ run : yarn test
7182
7283 test-types :
7384 name : Test Types with TypeScript ${{ matrix.ts }}
@@ -88,33 +99,33 @@ jobs:
8899 with :
89100 node-version : ${{ matrix.node }}
90101
91- - uses : c-hive/gha-npm-cache@v1
102+ - uses : actions/cache@v2
103+ with :
104+ path : .yarn/cache
105+ key : yarn-${{ hashFiles('yarn.lock') }}
106+ restore-keys : yarn-
92107
93108 - name : Install deps
94- run : npm ci --ignore-scripts
109+ run : yarn install
95110
96111 - name : Install TypeScript ${{ matrix.ts }}
97- run : npm install typescript@${{ matrix.ts }} --ignore-scripts
112+ run : yarn add typescript@${{ matrix.ts }}
98113
99114 - uses : actions/download-artifact@v2
100115 with :
101116 name : package
117+ path : packages/toolkit
102118
103119 - name : Install build artifact
104- run : |
105- sed -i -e '/"name": "@reduxjs\/toolkit",/d' package.json
106- npm i reduxjs-toolkit-*.tgz --ignore-scripts
107- sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./jest.config.js ./src/tests/*.* ./src/query/tests/*.*
120+ run : yarn add ./package.tgz
121+
122+ - run : sed -i -e /@remap-prod-remove-line/d ./tsconfig.base.json ./jest.config.js ./src/tests/*.* ./src/query/tests/*.*
108123
109124 - name : " @ts-ignore stuff that didn't exist pre-4.1 in the tests"
110125 if : ${{ matrix.ts < 4.1 }}
111126 run : sed -i -e 's/@pre41-ts-ignore/@ts-ignore/' -e '/pre41-remove-start/,/pre41-remove-end/d' ./src/tests/*.* ./src/query/tests/*.ts*
112127
113- - name : ' disable strictOptionalProperties'
114- if : ${{ matrix.ts == 'next' }}
115- run : sed -i -e 's|//\(.*strictOptionalProperties.*\)$|\1|' tsconfig.base.json
116-
117128 - name : Test types
118129 run : |
119- ./node_modules/.bin/ tsc --version
120- npm run type-tests
130+ yarn tsc --version
131+ yarn type-tests
0 commit comments