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

Enable cache in CI and locally for ESLint and Prettier #17384

Merged
merged 2 commits into from
Jul 22, 2023
Merged

Enable cache in CI and locally for ESLint and Prettier #17384

merged 2 commits into from
Jul 22, 2023

Conversation

steverep
Copy link
Member

@steverep steverep commented Jul 21, 2023

Proposed change

Aiming to speed up CI...

  • Turns on caching for ESLint and Prettier in package.json scripts and in precommit hook
  • Add cache to CI action using a short-lived key of the commit SHA (will always miss and grab either the latest from the PR or latest from dev branch)
  • Adds an action to run when pull requests close to clean up its caches

These caches are small (1M for ESLint and 12K for Prettier) so the cleanup is probably not strictly necessary. But if we add caching for the builds, those would be much bigger and the cleanup makes sense.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@github-actions github-actions bot added Dependencies Pull requests that update a dependency file GitHub Actions Pull requests that update GitHub Actions code labels Jul 21, 2023
@steverep steverep closed this Jul 21, 2023
@steverep
Copy link
Member Author

Closed and reopened to make sure the cleanup action works. Here's the successful run:

https://github.com/home-assistant/frontend/actions/runs/5626915394/job/15248625914

@steverep steverep reopened this Jul 21, 2023
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Thanks, @steverep 👍

../Frenck

@frenck frenck merged commit e21f951 into dev Jul 22, 2023
8 checks passed
@frenck frenck deleted the lint-cache branch July 22, 2023 17:52
@github-actions github-actions bot locked and limited conversation to collaborators Jul 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed Dependencies Pull requests that update a dependency file GitHub Actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants