Skip to content

Speed up Psalm tests #49001

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

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,30 @@ jobs:
name: Psalm
runs-on: Ubuntu-20.04

env:
php-version: '8.1'
extensions: json,couchbase,memcached,mongodb,redis,xsl,ldap,dom
steps:
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ env.php-version }}
extensions: ${{ env.extensions }}
key: cache-v1 # can be any string, change to clear the extension cache.
Copy link
Member

@nicolas-grekas nicolas-grekas Feb 13, 2023

Choose a reason for hiding this comment

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

on 6.3 the list of extensions is not the same as on 6.2/5.4
shouldn't we vary this by php-version + extensions?

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 haven't used GitHub Actions caching much, but I think it will attempt to restore the cache from the current branch before falling back to the default branch. So there shouldn't be any harm in reusing a cache key across branches.


- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: "json,couchbase,memcached,mongodb,redis,xsl,ldap,dom"
php-version: ${{ env.php-version }}
extensions: ${{ env.extensions }}
ini-values: "memory_limit=-1"
coverage: none

Expand Down