forked from microsoft/react-native-macos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove home-rolled yarn caching (facebook#48237)
Summary: Pull Request resolved: facebook#48237 Noticed this when trying to diagnose what seemed like a stale caching issue. It effectively reverts D59917944. D59917944 added logic to only do yarn caching on main, but it has some correctness issues: 1. We cache `node_modules` instead of the yarn cache, which may contain e.g. build artifacts, or other scratch/cache files written (such as anything that writes to `node_modules/.cache`). We really want to be caching the yarn cache, which has pristine packages before install, which I think it will also need to perform the real install anyways. 2. We key the cache on root `package.json`, which is missing a lot of information (both provided by the other `package.json` in the repo, but mostly, the lockfile resolution). We only save cache when we're on `refs/heads/main` (so continuous builds against main), and supposedly, builds against base branch should be able to restore against those, but recent PR jobs I have seen, where `package.json` has not changed, all have `Cache not found for input keys: node-modules-068350889e87919c1c6c2c220c8d2d92db13f38820bf2efb315d1274b97bc367` Because of the potential correctness issues, and that the strategy for limiting to main seemingly is not allowing cache to be used in PR, this diff goes back to previous solution, which may store more artifacts (but working cache should also reduce cost by making jobs run faster). Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D67140004 fbshipit-source-id: f74074a498af56b1837fa23cf80795f76935b762
- Loading branch information
1 parent
9f4b4ab
commit a28867f
Showing
14 changed files
with
21 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ runs: | |
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ runs: | |
shell: bash | ||
run: ls -lR "$HERMES_WS_DIR" | ||
- name: Run yarn | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Setup ruby | ||
uses: ruby/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: yarn-install | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Install dependencies | ||
shell: bash | ||
run: yarn install --non-interactive --frozen-lockfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,7 +242,7 @@ jobs: | |
- name: Setup node.js | ||
uses: ./.github/actions/setup-node | ||
- name: Run yarn | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Setup ruby | ||
uses: ruby/[email protected] | ||
with: | ||
|
@@ -320,7 +320,7 @@ jobs: | |
- name: Setup node.js | ||
uses: ./.github/actions/setup-node | ||
- name: Run yarn | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
|
@@ -451,7 +451,7 @@ jobs: | |
- name: Setup node.js | ||
uses: ./.github/actions/setup-node | ||
- name: Install node dependencies | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Download APK | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -533,7 +533,7 @@ jobs: | |
- name: Setup gradle | ||
uses: ./.github/actions/setup-gradle | ||
- name: Run yarn install | ||
uses: ./.github/actions/yarn-install-with-cache | ||
uses: ./.github/actions/yarn-install | ||
- name: Prepare the Helloworld application | ||
shell: bash | ||
run: node ./scripts/e2e/init-project-e2e.js --useHelloWorld --pathToLocalReactNative "$GITHUB_WORKSPACE/build/$(cat build/react-native-package-version)" | ||
|
This file was deleted.
Oops, something went wrong.