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

Only save /tmp/phpstan/resultCache.php to cache #3427

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

teohhanhui
Copy link
Contributor

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

The result cache is a huge win.

CircleCI takes a very long time saving /tmp/phpstan/cache for some reason,
and this cache doesn't affect the run time much anyway.

The result cache is a huge win.

CircleCI takes a very long time saving /tmp/phpstan/cache for some reason,
and this cache doesn't affect the run time much anyway.
@teohhanhui
Copy link
Contributor Author

Somehow the result cache is not being used. Investigating...

@teohhanhui
Copy link
Contributor Author

/cc @ondrejmirtes perhaps you could lend a hand here... 🙏

Here you can see that /tmp/phpstan/resultCache.php is restored (and the archive size of 36 KiB matches what I have locally):
https://app.circleci.com/jobs/github/api-platform/core/22032/parallel-runs/0/steps/0-113

But here phpstan is taking 14s, so it doesn't seem like the result cache is being used:
https://app.circleci.com/jobs/github/api-platform/core/22032/parallel-runs/0/steps/0-114

Is there some kind of file modification checking that breaks with a CI workflow?

@ondrejmirtes
Copy link

Yes, in some CI systems the file modification time will not be preserved across runs. I plan to switch to file hashes instead but I need to inspect performance implications of that.

@ondrejmirtes
Copy link

Right now I verified the result cache works in Jenkins and TeamCity, but I'm not sure about GitLab CI and similar Docker-based systems.

@teohhanhui
Copy link
Contributor Author

md5 should be very fast, even though it's prone to collisions... But good enough for this kind of use case. 😆

@teohhanhui
Copy link
Contributor Author

Merging as is to avoid the CircleCI issue with saving /tmp/phpstan/cache.

@teohhanhui teohhanhui merged commit 53ae703 into api-platform:2.5 Mar 5, 2020
@teohhanhui teohhanhui deleted the fix/ci-phpstan-cache branch March 5, 2020 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants