Files
actions/php-composer
Ismo Vuorinen a315fff258 refactor: eliminate common-cache, use actions/cache directly
Replace common-cache wrapper with native actions/cache in npm-publish
and php-composer, completing the caching optimization campaign.

Changes:
1. npm-publish (lines 107-114):
   - Replace common-cache with actions/cache@v4.3.0
   - Use hashFiles() for node_modules cache key
   - Support multiple lock files (package-lock, yarn.lock, pnpm, bun)

2. php-composer (lines 177-190):
   - Replace common-cache with actions/cache@v4.3.0
   - Use multiline YAML for cleaner path configuration
   - Use hashFiles() for composer cache key
   - Support optional cache-directories input

Benefits:
- Native GitHub Actions functionality (no wrapper overhead)
- Better performance (no extra action call)
- Simpler maintenance (one less internal action)
- Standard approach used by official actions
- Built-in hashFiles() more efficient than manual sha256sum

Result:
- Eliminates all common-cache usage (reduced from 4 to 0 actions)
- common-cache action can now be deprecated/removed
- Completes caching optimization: 11 → 0 common-cache dependencies

Campaign summary:
- Phase 1: Inline language-version-detect
- Phase 2: Migrate 6 actions to setup-* native caching
- Phase 3: Replace go-lint common-cache with actions/cache
- Phase 4: Eliminate remaining common-cache (npm, php)
2025-11-20 14:29:28 +02:00
..

ivuorinen/actions/php-composer

Run Composer Install

Description

Runs Composer install on a repository with advanced caching and configuration.

Inputs

name description required default
php

PHP Version to use.

true 8.4
extensions

Comma-separated list of PHP extensions to install

false mbstring, xml, zip, curl, json
tools

Comma-separated list of Composer tools to install

false composer:v2
args

Arguments to pass to Composer.

false --no-progress --prefer-dist --optimize-autoloader
composer-version

Composer version to use (1 or 2)

false 2
stability

Minimum stability (stable, RC, beta, alpha, dev)

false stable
cache-directories

Additional directories to cache (comma-separated)

false ""
token

GitHub token for private repository access

false ""
max-retries

Maximum number of retry attempts for Composer commands

false 3

Outputs

name description
lock

composer.lock or composer.json file hash

php-version

Installed PHP version

composer-version

Installed Composer version

cache-hit

Indicates if there was a cache hit

Runs

This action is a composite action.

Usage

- uses: ivuorinen/actions/php-composer@main
  with:
    php:
    # PHP Version to use.
    #
    # Required: true
    # Default: 8.4

    extensions:
    # Comma-separated list of PHP extensions to install
    #
    # Required: false
    # Default: mbstring, xml, zip, curl, json

    tools:
    # Comma-separated list of Composer tools to install
    #
    # Required: false
    # Default: composer:v2

    args:
    # Arguments to pass to Composer.
    #
    # Required: false
    # Default: --no-progress --prefer-dist --optimize-autoloader

    composer-version:
    # Composer version to use (1 or 2)
    #
    # Required: false
    # Default: 2

    stability:
    # Minimum stability (stable, RC, beta, alpha, dev)
    #
    # Required: false
    # Default: stable

    cache-directories:
    # Additional directories to cache (comma-separated)
    #
    # Required: false
    # Default: ""

    token:
    # GitHub token for private repository access
    #
    # Required: false
    # Default: ""

    max-retries:
    # Maximum number of retry attempts for Composer commands
    #
    # Required: false
    # Default: 3