52
52
with :
53
53
path : |
54
54
**/node_modules
55
- key : ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
55
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/ yarn.lock') }}
56
56
57
57
- name : Install dependencies
58
58
if : steps.root-yarn-cache.outputs.cache-hit != 'true'
@@ -63,14 +63,10 @@ jobs:
63
63
run : |
64
64
yarn workspace create-react-native-library prepare
65
65
66
- - name : Create temporary working directory
67
- run : |
68
- mkdir ../tmp
69
-
70
66
- name : Create library
71
- working-directory : ../tmp
72
67
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" \
74
70
--slug react-native-test \
75
71
--description test \
76
72
--author-name test \
@@ -80,33 +76,33 @@ jobs:
80
76
--type ${{ matrix.type }} \
81
77
--languages ${{ matrix.language }} \
82
78
--example ${{ matrix.example }}
79
+ echo "work_dir=$WORK_DIR" >> $GITHUB_ENV
83
80
84
81
- name : Cache dependencies of library
85
82
id : library-yarn-cache
86
83
uses : actions/cache@v3
87
84
with :
88
85
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')) }}
92
88
93
89
- name : Install dependencies of library
94
90
if : steps.library-yarn-cache.outputs.cache-hit != 'true'
95
- working-directory : ../tmp/react-native-test
91
+ working-directory : ${{ env.work_dir }}
96
92
run : |
97
93
yarn
98
94
99
95
- name : Lint library
100
- working-directory : ../tmp/react-native-test
96
+ working-directory : ${{ env.work_dir }}
101
97
run : |
102
98
yarn lint
103
99
104
100
- name : Typecheck library
105
- working-directory : ../tmp/react-native-test
101
+ working-directory : ${{ env.work_dir }}
106
102
run : |
107
103
yarn typescript
108
104
109
105
- name : Test library
110
- working-directory : ../tmp/react-native-test
106
+ working-directory : ${{ env.work_dir }}
111
107
run : |
112
108
yarn test
0 commit comments