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

[CI] Refactor: clean up github workflows for cache correctness #6029

Merged
merged 16 commits into from
May 5, 2024

Conversation

etrepum
Copy link
Contributor

@etrepum etrepum commented May 5, 2024

Description

We have a lot of test workflow. The workflows could get in various states where the cache was poisoned.

The cache correctness related changes:

  • Use the actions/setup-node@v4 cache: npm option which also considers the node version, and should in theory do the right thing (the actions/cache docs recommend to not cache node_modules as we were doing)
  • Use npm ci. Maybe a little slower than caching node_modules, takes about 30s, but the global artifacts should be cached and we have a postinstall action to run for wxt with the lexical-devtools package which was the cause of some of the problems.
  • Move playwright caching to its own step which a cache key that includes all the things
  • Add a reusable e2e-test workflow to make the multiple matrix jobs easier to manage

Test plan

Before

Sometimes get strange build failures due to poisoned cache (hard to intentionally repro)

After

  • All expected matrix combinations are still tested
  • Tests pass
  • Hopefully cache poisoning won't happen anymore

Copy link

vercel bot commented May 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2024 6:04am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2024 6:04am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 5, 2024
@@ -127,7 +127,7 @@ export default defineConfig({
find: 'lexicalOriginal',
replacement: path.resolve('../lexical/src/index.ts'),
},
...moduleResolution('preview'),
...moduleResolution('source'),
Copy link
Contributor Author

@etrepum etrepum May 5, 2024

Choose a reason for hiding this comment

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

I don't know how this didn't get caught by the integrity check before it was merged?

@etrepum etrepum changed the title [WIP][CI] Refactor: clean up github workflows for cache correctness [CI] Refactor: clean up github workflows for cache correctness May 5, 2024
@etrepum etrepum marked this pull request as ready for review May 5, 2024 04:37
# Run daily at 2:30am UTC
# - cron: '30 2 * * 1-5'
# remove the workflow_dispatch when this is turned on
workflow_dispatch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this so I would stop getting emails about it on every push

* yaml package.json configuration, because we need to override the resolution
* of modules to ensure we are pulling in monorepo build products as
* dependencies rather than trying to use something stale from node_modules.
*/
const glob = require('glob');
const path = require('node:path');
const fs = require('fs-extra');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed this unused import and typo when I was auditing the workflows

@ivailop7 ivailop7 merged commit dfe4b8c into facebook:main May 5, 2024
45 checks passed
@etrepum etrepum deleted the workflow-cache-cleanup branch May 5, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants