Skip to content

Commit

Permalink
Reduce install network flake (#27464)
Browse files Browse the repository at this point in the history
## Summary

Avoids potentially flaky network calls leading to failures such as
https://app.circleci.com/pipelines/github/facebook/react/47096/workflows/b7966c1d-199c-4185-8d17-ac6485235c3a/jobs/727782.
Also makes install faster since we don't need the binary in CI
seemingly.

Electron itself is used to start the standalone binary.

## How did you test this change?

- [x] CI still passes without the binary downloaded. I'm just trusting
[their
docs](https://www.electronjs.org/docs/latest/tutorial/installation) here
that setting this actually ensures the binary isn't downloaded.
  • Loading branch information
eps1lon authored Oct 5, 2023
1 parent 0fba3ec commit 16619f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ commands:
if [ $? -ne 0 ]; then
yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
fi
environment:
# If we start needing the Electron binary, please ensure the binary is cached in CI following https://www.electronjs.org/docs/latest/tutorial/installation
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
- save_cache:
name: Save yarn cache
key: v2-yarn_cache-{{ arch }}-{{ checksum "yarn.lock" }}
Expand Down

2 comments on commit 16619f1

@abdishakour10
Copy link

Choose a reason for hiding this comment

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

my brothers and sisters, help me i wanna learn how to use git hup
ins: Abdishakour.ali

@devichand1319
Copy link

Choose a reason for hiding this comment

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

This code snippet is part of a CircleCI configuration and serves to optimize the CI/CD pipeline for a project. It checks the success of the Yarn installation and sets an environment variable to skip downloading Electron binaries in the CI environment. It also caches the Yarn package manager's cache for faster future builds.

Please sign in to comment.