Skip to content

Commit

Permalink
minor #49001 Speed up Psalm tests (danepowell)
Browse files Browse the repository at this point in the history
This PR was submitted for the 6.3 branch but it was squashed and merged into the 5.4 branch instead.

Discussion
----------

Speed up Psalm tests

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix.
This will help reviewers and should be a good start for the documentation.

Additionally (see https://symfony.com/releases):
 - Always add tests and ensure they pass.
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against the latest branch.
 - For new features, provide some code snippets to help understand usage.
 - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
 - Never break backward compatibility (see https://symfony.com/bc).
-->

The setupphp maintainer [recommends caching the couchbase extension](shivammathur/setup-php#593 (comment)) using the [cache-extensions action](https://github.com/shivammathur/cache-extensions). This should speed up Psalm runs from 14 minutes to 2 minutes!

Commits
-------

89be707 Speed up Psalm tests
  • Loading branch information
nicolas-grekas committed Feb 13, 2023
2 parents 737cc4c + 89be707 commit 99d2424
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/psalm.yml
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.

- 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

0 comments on commit 99d2424

Please sign in to comment.