Skip to content

Commit

Permalink
test(ci): hashFiles on specific files vs big globs
Browse files Browse the repository at this point in the history
should help workaround hashFile failures flaking CI builds,
and be a lot faster too since recursive search is not necessary

At same time, nothing recursively can change without these lock
files changing, so it should be equivalent
  • Loading branch information
mikehardy committed Aug 14, 2022
1 parent f85b19c commit dc74643
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create_test_patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

- name: Yarn Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
uses: nick-invision/retry@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
uses: nick-invision/retry@v2
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
uses: nick-invision/retry@v2
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-with-website-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-with-website-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-with-website-v1
- name: Yarn Install
uses: nick-invision/retry@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

- name: Yarn Install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.workflow-variables.outputs.yarn-cache-dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1

- uses: actions/cache@v2
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
id: pods-cache
with:
path: tests/ios/Pods
key: ${{ runner.os }}-pods-v2-${{ hashFiles('**/Podfile.lock') }}
key: ${{ runner.os }}-pods-v2-${{ hashFiles('tests/ios/Podfile.lock') }}
restore-keys: ${{ runner.os }}-pods-v2

- name: Pod Install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests_jest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('**/package.json') }}
key: ${{ runner.os }}-yarn-v1-${{ hashFiles('yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-v1
- name: Yarn Install
uses: nick-invision/retry@v2
Expand Down

1 comment on commit dc74643

@vercel
Copy link

@vercel vercel bot commented on dc74643 Aug 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.