-
Notifications
You must be signed in to change notification settings - Fork 39
Speed Up CI/CD Workflows by Caching Dependency Installations #2535
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
base: master
Are you sure you want to change the base?
Conversation
…and WP environment
…ing redundant caching
- Simplified action description and input parameters for better clarity - Removed verbose debug logging steps to make workflow more concise - Optimized cache key generation to use direct package-lock.json path - Simplified npm installation step by removing redundant validation checks - Updated npm logs artifact path to use platform-independent home directory - Renamed workflow steps to be more descriptive and consistent
- Shortened and clarified action name and description for better readability - Simplified input description for node-version parameter - Renamed workflow steps to be more concise and descriptive - Maintained same core functionality while making labels more user-friendly - Updated step names to better reflect their purpose (e.g. "Restore cached dependencies" instead of "Cache node_modules")
- Added space between domReady and parenthesis to match project code style conventions - Maintains consistent spacing pattern used throughout the codebase
- Updated spacing around function parentheses in domReady callback to match WordPress JS coding standards - Added spaces between parentheses and curly braces for consistency
- Added caching for Cypress binary using actions/cache to speed up CI builds - Added step to extract Cypress version and cache folder path for cache key generation - Cache key includes OS and Cypress version to ensure proper cache invalidation when version changes
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2535 +/- ##
=========================================
Coverage 26.95% 26.95%
- Complexity 8838 8842 +4
=========================================
Files 144 144
Lines 29803 29809 +6
=========================================
+ Hits 8032 8035 +3
- Misses 21771 21774 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Added explicit Cypress binary installation step when cache miss occurs - Added cache-hit check using cache action output to prevent redundant installations - Maintained existing caching strategy for Cypress binary using version-specific keys
- Upgraded setup-node from v5.0.0 to v6.0.0 - Upgraded cache action from v4.2.4 to v4.3.0 - Upgraded upload-artifact from v4.6.2 to v5.0.0 - Removed Cypress binary caching in favor of simpler installation flow
- Created reusable composite actions for checkout and PHP setup to reduce duplication - Updated workflows to use new composite actions instead of inline steps - Standardized action versions with commit SHA pinning for security
- Replaced custom checkout action with official actions/[email protected] in Cypress and JSCS workflows - Added descriptive step names for checkout actions to improve workflow readability
- Replaced custom PHP setup action with direct composer install - Consolidated Node.js setup and dependency installation into single reusable action
- Replaced custom setup-php action with direct composer install - Removed intermediate setup step to streamline CI process
…s-workflow-composer
- Moved workflow name to top for better readability - Updated checkout action to v5.0.0 with commit SHA pinning for security - Added explicit step name for checkout action
… action - Updated checkout action from v4.1.1 to v5.0.0 with pinned commit hash for security - Simplified step name from "📥 Fetching Repository Contents" to "Checkout code" - Reorganized workflow structure by moving name to top and removing extra blank lines
- Reorganized workflow structure by moving name to top for better readability - Updated checkout action to v5.0.0 with pinned commit hash for security - Cleaned up formatting and removed redundant comments
- Moved workflow name to top of file for better readability - Updated checkout action to v5.0.0 with commit SHA pinning for security - Removed redundant comments
- Standardized YAML indentation and spacing for better readability - Pinned checkout action to specific commit hash for supply chain security - Added descriptive step name for checkout action
- Standardized YAML indentation and spacing for better readability - Pinned checkout action to specific commit hash for supply chain security - Added descriptive name to checkout step for clarity
- Updated checkout action to v5.0.0 with commit SHA pinning for improved security - Normalized YAML indentation and spacing throughout the workflow file - Reorganized workflow structure by moving name to top of file
- Reorganized workflow structure by moving name to top for better readability - Pinned checkout action to specific commit hash for security - Added descriptive step name for checkout action
- Moved workflow name to top of file following GitHub Actions conventions - Pinned checkout action to specific commit hash for security - Added descriptive step names for better workflow readability
- Reorganized workflow structure by moving name to top for better readability - Updated checkout action from v4 to v5.0.0 with pinned commit hash for security - Standardized indentation and removed outdated comments
WalkthroughA Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.nvmrc (1)
1-1: Correct.nvmrcformat, but verify version pinning strategy and PR alignment.The
.nvmrcfile is correctly formatted for nvm. However, a few points to consider:
- Version pinning: Specifying
20uses the latest patch version of Node.js 20, which can introduce variability. Consider pinning to a specific version (e.g.,20.11.0) for reproducible builds, especially in CI/CD contexts.- PR objective alignment: The PR is titled "Speed Up CI/CD Workflows by Caching Dependency Installations," but adding
.nvmrcalone does not implement caching. Verify that GitHub Actions workflow files are also being updated to cachenode_modulesor npm dependencies.- Configuration consistency: Ensure that Node.js version 20 is consistent with any version specifications in
.github/workflows/files,package.jsonengines field, or Docker configurations.Please verify:
- Whether "20" is intentionally loose or should be pinned to a specific minor/patch version.
- Whether GitHub Actions workflows (expected in
.github/workflows/) are also part of this PR to implement caching.- Whether other configuration files specify Node.js versions that should be aligned.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (15)
.github/setup-node/action.ymlis excluded by!**/*.yml.github/workflows/cypress.ymlis excluded by!**/*.yml.github/workflows/jscs.ymlis excluded by!**/*.yml.github/workflows/php-cs-fixer.ymlis excluded by!**/*.yml.github/workflows/phpcs.ymlis excluded by!**/*.yml.github/workflows/phpstan.ymlis excluded by!**/*.yml.github/workflows/phpunit.ymlis excluded by!**/*.yml.github/workflows/psalm.ymlis excluded by!**/*.yml.github/workflows/push-asset-readme-update.ymlis excluded by!**/*.yml.github/workflows/push-deploy.ymlis excluded by!**/*.yml.github/workflows/qadelete.ymlis excluded by!**/*.yml.github/workflows/qadeploy.ymlis excluded by!**/*.yml.github/workflows/rector.ymlis excluded by!**/*.yml.github/workflows/syntax.ymlis excluded by!**/*.yml.github/workflows/typos.ymlis excluded by!**/*.yml
📒 Files selected for processing (1)
.nvmrc(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cypress
…s-workflow-composer
No description provided.