Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: simplify build script #27547

Merged
merged 6 commits into from
Aug 15, 2023
Merged

chore: simplify build script #27547

merged 6 commits into from
Aug 15, 2023

Conversation

astone123
Copy link
Contributor

Right now our build script runs three different Lerna commands to make sure that packages are built in the correct order. We don't need to do this anymore because we can specify which packages depend on which other packages to ensure that they build in the correct order.

This PR updates our build script to just run lerna run build, which builds all of the packages in the repo, relying on the dependency graph in order to know which packages need to be built in which order.

@@ -185,6 +186,9 @@
"{projectRoot}/build"
]
}
}
},
"implicitDependencies": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This tells Nx that all of the NPM packages need to be built before the CLI is built. We need to do this because the post-build script in CLI copies the built assets for each NPM package into the cli/build folder, so when that happens, all of the packages need to have already been built.

@@ -14,8 +14,7 @@
"binary-zip": "node ./scripts/binary.js zip",
"binary-package": "cross-env NODE_OPTIONS=--max_old_space_size=8192 node ./scripts/binary.js package",
"check-binary-on-cdn": "node ./scripts/binary.js checkIfBinaryExistsOnCdn",
"build": "yarn build-npm-modules && lerna run build --stream --no-bail --ignore create-cypress-tests --ignore cypress --ignore \"'@packages/{runner}'\" --ignore \"'@cypress/{angular,react,react18,vue,vue2,mount-utils,svelte}'\" && node ./cli/scripts/post-build.js && lerna run build --stream --scope create-cypress-tests",
"build-npm-modules": "lerna run build --scope cypress --scope @cypress/mount-utils --scope @cypress/react && lerna run build --scope \"'@cypress/{angular,react18,vue,vue2,svelte}'\"",
"build": "lerna run build --stream",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to run all of these scripts independently, we can just tell Lerna to build and it will handle the order in which things are built

@cypress
Copy link

cypress bot commented Aug 14, 2023

33 flaky tests on run #49996 ↗︎

0 27948 1354 0 Flakiness 33

Details:

Merge branch 'develop' into astone123/simplify-build
Project: cypress Commit: 657325981c
Status: Passed Duration: 23:08 💡
Started: Aug 15, 2023 9:12 PM Ended: Aug 15, 2023 9:36 PM
Flakiness  runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
... > displays a list of recorded runs if a run has been recorded Output Screenshots Video
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Output Screenshots Video
Flakiness  cypress-origin-communicator.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress In Cypress Origin Communicator > cy.origin passivity with app interactions > passes upon test reload mid test execution Output Screenshots Video
Flakiness  e2e/origin/cookie_login.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
cy.origin - cookie login > general behavior > works in a session Output Video
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output Video

The first 5 flaky specs are shown, see all 21 specs in Cypress Cloud.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@@ -1189,10 +1189,6 @@ commands:
command: |
source ./scripts/ensure-node.sh
yarn build --scope cypress
- run:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This runs as a postbuild script, so it will run in the previous step. No need to run it again

@@ -1910,7 +1906,7 @@ jobs:
- restore_cached_workspace
- run:
name: Build
command: yarn lerna run build --scope @cypress/webpack-preprocessor
command: yarn build --scope @cypress/webpack-preprocessor
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to reference Lerna specifically in these scripts, just call yarn build and pass the arguments through.

@nagash77 nagash77 merged commit 0a86ec6 into develop Aug 15, 2023
78 of 80 checks passed
@nagash77 nagash77 deleted the astone123/simplify-build branch August 15, 2023 23:54
astone123 added a commit that referenced this pull request Aug 17, 2023
astone123 added a commit that referenced this pull request Aug 17, 2023
* chore: simplify build script

* update CI workflows

* fix workflows

* empty commit because Percy weirdness
nagash77 pushed a commit that referenced this pull request Aug 18, 2023
* Revert "chore: remove Typescript dependency from app node_modules in binary (#27577)"

This reverts commit 60d4c83.

* Revert "chore: simplify build script (#27547)"

This reverts commit 0a86ec6.

* Revert "chore: upgrade lerna to 6, cache build step (#26913)"

This reverts commit 9e60aeb.

* build everything

* [run ci]
astone123 added a commit that referenced this pull request Aug 18, 2023
astone123 added a commit that referenced this pull request Aug 18, 2023
* chore: simplify build script

* update CI workflows

* fix workflows

* empty commit because Percy weirdness
astone123 added a commit that referenced this pull request Aug 21, 2023
astone123 added a commit that referenced this pull request Aug 21, 2023
* chore: simplify build script

* update CI workflows

* fix workflows

* empty commit because Percy weirdness
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 29, 2023

Released in 13.0.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.0.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants