Skip to content

ci(artifact): add build artifacts - #14171

Merged
WikiRik merged 18 commits into
mainfrom
WikiRik/workflow-artifact
Feb 26, 2022
Merged

WikiRik merged 18 commits into
mainfrom
WikiRik/workflow-artifact

Conversation

@WikiRik

@WikiRik WikiRik commented Feb 25, 2022 •

Copy link
Copy Markdown
Member

Pull Request Checklist

Please make sure to review and check all of these items:

  • Have you added new tests to prevent regressions?
  • Does yarn test or yarn test-DIALECT pass with this change (including linting)?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description Of Change

This PR speeds up CI by about a few minutes in total through introducing build artifacts that are made once and used for all other jobs, minimizing duplication throughout the workflow.
It also uses npm install --no-save --no-audit for the other TypeScript versions to be installed quicker. This is also done for pg-native on Node 16 but due to issues with dependencies not for pg-native on Node 12.
It also enables caching for setup-node step.
Finally, it pins the versions of MySQL and MariaDB to the patch releases. This will prompt updates by renovate so we will not have to check for updates manually.

@ephys

ephys commented Feb 25, 2022 •

Copy link
Copy Markdown
Member

TypeScript: it looks like yarn add causes a full rebuild of all packages with a build step (like ibm_db), and runs sequelize's build script (npm run build && husky install)

It's a bit hacky but we could do npm i --no-save [email protected] --no-audit instead. It doesn't seem to be rebuilding ibm_db, and it doesn't run our build script. no-audit reduces the install time drastically too.

@WikiRik

WikiRik commented Feb 25, 2022

Copy link
Copy Markdown
Member Author

TypeScript: it looks like yarn add causes a full rebuild of all packages with a build step (like ibm_db), and runs sequelize's build script (npm run build && husky install)

Yes, the build script is not a huge thing since not letting it run is probably going to cost more than it will benefit in CI but the full rebuild is what we should avoid.

It's a bit hacky but we could do npm i --no-save [email protected] --no-audit instead. It doesn't seem to be rebuilding ibm_db, and it doesn't run our build script. no-audit reduces the install time drastically too.

But that's using npm. I quickly searched for a no-save alternative for yarn v1 but didn't find anything yet. I'll still change it for now but preferably I want to remain using yarn here

@WikiRik WikiRik changed the title [WIP] ci(artifact): add build artifacts ci(artifact): add build artifacts Feb 26, 2022
@WikiRik
WikiRik requested review from ephys and sdepold February 26, 2022 00:04
@WikiRik
WikiRik marked this pull request as ready for review February 26, 2022 00:04
@WikiRik

WikiRik commented Feb 26, 2022

Copy link
Copy Markdown
Member Author

I still want to change the TypeScript install back to yarn in a future PR but this --no-save does not impact the other dependencies so it's fine for now. I will improve that in a future PR. For now I'm happy that this reduces every check by about 2 minutes

@ephys

ephys commented Feb 26, 2022

Copy link
Copy Markdown
Member

Using npm for that specific command shouldn't have a negative impact as npm seems to only be touching the typescript package (and eventual dependencies) the same way yarn would have. And in both scenarios we would have been bypassing the lockfile

@ephys

ephys commented Feb 26, 2022

Copy link
Copy Markdown
Member

We should consider doing the same for pg-native

@WikiRik

WikiRik commented Feb 26, 2022

Copy link
Copy Markdown
Member Author

Using npm for that specific command shouldn't have a negative impact as npm seems to only be touching the typescript package (and eventual dependencies) the same way yarn would have. And in both scenarios we would have been bypassing the lockfile

Yes indeed. That's why it's fine for now. I just like the consistency for using yarn everywhere

@WikiRik

WikiRik commented Feb 26, 2022

Copy link
Copy Markdown
Member Author

We should consider doing the same for pg-native

I completely missed that. Will add that. Thanks!

@ephys

ephys commented Feb 26, 2022

Copy link
Copy Markdown
Member

Looks like while doing it for TypeScript worked fine, doing it for pg-native doesn't. npm doesn't update the module tree correctly :(
Definitely a hack, let's keep it for TypeScript for now as long as it's documented

@WikiRik
WikiRik marked this pull request as draft February 26, 2022 11:17
@WikiRik

WikiRik commented Feb 26, 2022

Copy link
Copy Markdown
Member Author

Only on Node 12 though so I'll just return to yarn add for Node 12 and keep npm install --no-save for Node 16

@WikiRik
WikiRik force-pushed the WikiRik/workflow-artifact branch from 13d5be8 to 6641967 Compare February 26, 2022 11:23
@ephys ephys mentioned this pull request Feb 26, 2022
2 of 6 tasks
@ephys

ephys commented Feb 26, 2022

Copy link
Copy Markdown
Member

Really appreciating the performance boost 🥰

@WikiRik
WikiRik force-pushed the WikiRik/workflow-artifact branch from 68c1636 to c084264 Compare February 26, 2022 11:47
@WikiRik
WikiRik marked this pull request as ready for review February 26, 2022 11:58
@WikiRik

WikiRik commented Feb 26, 2022

Copy link
Copy Markdown
Member Author

Okay, I think it's done now. Next steps for further performance boost is related to DB2 but that's for a later moment

Comment thread .github/workflows/ci.yml Resolved
Comment thread .github/workflows/ci.yml Resolved
ephys
ephys previously approved these changes Feb 26, 2022

@ephys ephys left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Other than that, good to go

@WikiRik
WikiRik merged commit 0d1ee69 into main Feb 26, 2022
@WikiRik
WikiRik deleted the WikiRik/workflow-artifact branch February 26, 2022 17:24
@WikiRik WikiRik mentioned this pull request Feb 26, 2022
3 of 6 tasks
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 7.0.0-alpha.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

vanthome pushed a commit to vanthome/sequelize that referenced this pull request Jun 12, 2022
* ci(artifact): add build artifacts

* ci(artifact): use tar archiving

* ci(artifact): add Node 12 build

* ci(test): combine unit test

* ci(types): ensure that test-typings pass before release

* build: fix typo in test-unit-all

* ci(test): add Node 12 unit test

* ci(artifact): combine install-and-build steps

* ci: fix typo

* ci(mysql/mariadb): specify patch version for MySQL and MariaDB

* ci(typescript): move to npm i --no-save

* ci(mariadb): fix patch version of MariaDB 10.5

* ci(pg-native): improve speed pg-native install

* ci(pg-native): fix install on Node 12

* ci(artifact): retain artifacts for 1 day

* ci(pg-native): rebuild sequelize after installing pg-native

* ci(setup-node): add caching

* ci: implement requested changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants