5252        with :
5353          path : | 
5454            **/node_modules 
55- key : ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} 
55+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/ yarn.lock') }} 
5656
5757      - name : Install dependencies 
5858        if : steps.root-yarn-cache.outputs.cache-hit != 'true' 
@@ -63,14 +63,10 @@ jobs:
6363        run : | 
6464          yarn workspace create-react-native-library prepare 
6565
66- name : Create temporary working directory 
67-         run : | 
68-           mkdir ../tmp 
69- 
7066name : Create library 
71-         working-directory : ../tmp 
7267        run : | 
73-           ../react-native-builder-bob/packages/create-react-native-library/bin/create-react-native-library react-native-test \ 
68+           WORK_DIR=tmp-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.example }} 
69+           ./packages/create-react-native-library/bin/create-react-native-library "$WORK_DIR" \ 
7470            --slug react-native-test \ 
7571            --description test \ 
7672            --author-name test \ 
@@ -80,33 +76,33 @@ jobs:
8076            --type ${{ matrix.type }} \ 
8177            --languages ${{ matrix.language }} \ 
8278            --example ${{ matrix.example }} 
79+           echo "work_dir=$WORK_DIR" >> $GITHUB_ENV 
8380
8481name : Cache dependencies of library 
8582        id : library-yarn-cache 
8683        uses : actions/cache@v3 
8784        with :
8885          path : | 
89-             ../tmp/react-native-test/node_modules 
90-             ../tmp/example/node_modules 
91- key : ${{ runner.os }}-library-yarn-${{ matrix.type }}-${{ matrix.language }}-${{ matrix.example}}-${{ hashFiles('yarn.lock') }} 
86+             ${{ env.work_dir }}/**/node_modules 
87+ key : ${{ runner.os }}-library-yarn-${{ hashFiles(format(env.work_dir, '/**/package.json')) }} 
9288
9389      - name : Install dependencies of library 
9490        if : steps.library-yarn-cache.outputs.cache-hit != 'true' 
95-         working-directory : ../tmp/react-native-test 
91+         working-directory : ${{ env.work_dir }} 
9692        run : | 
9793          yarn 
9894
9995name : Lint library 
100-         working-directory : ../tmp/react-native-test 
96+         working-directory : ${{ env.work_dir }} 
10197        run : | 
10298          yarn lint 
10399
104100name : Typecheck library 
105-         working-directory : ../tmp/react-native-test 
101+         working-directory : ${{ env.work_dir }} 
106102        run : | 
107103          yarn typescript 
108104
109105name : Test library 
110-         working-directory : ../tmp/react-native-test 
106+         working-directory : ${{ env.work_dir }} 
111107        run : | 
112108          yarn test 
0 commit comments