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

Use phpcs and phpstan result cache in github actions #763

Open
wants to merge 5 commits into
base: 3.x
Choose a base branch
from

Conversation

wotnak
Copy link
Collaborator

@wotnak wotnak commented Jan 1, 2024

Adds several optimizations to how phpcs and phpstan are run in github actions:

  • run phpcs checks in parallel
    • phpcs by default runs all checks in series but provides cli argument that allows to execute checks in parallel
  • combine PHP compatibility checks of contrib modules and themes into single phpcs run
    • passing two paths at the same time allows to skip additional phpcs bootstrapping time
  • use phpcs results cache and persist it between workflow runs
    • using results cache can significantly speedup performing checks since checks are run only for files that changed or are missing from cache
  • persist phpstan result cache between workflow runs
    • phpstan uses results cache by default but in github actions it is discarded after container stops, this change allows for it to be shared between workflow runs

Copy link
Member

@paul121 paul121 left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @wotnak.

The one thing I'm hung up on is caching... I see how this could be nice but it feels like it could be a lot of complexity to maintain here. I'm really just not too familiar with github actions caching.. kinda wonder if it could cause any false positive "passing" tests, but in theory it shouldn't?

I assume the phpcs in parallel would still be the largest improvement anyways? Maybe we just start with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants