Skip to content

CI: Lint job does not pin PHP version — non-deterministic behavior #169

@s2x

Description

@s2x

Problem

The lint job in tests.yaml uses shivammathur/setup-php without specifying a php-version, which means it defaults to whatever PHP version is pre-installed on the GitHub Actions runner. This makes the lint results non-deterministic:

  • Different runner images may have different PHP versions
  • GitHub periodically updates runner images, changing the default PHP version
  • Lint rules may produce different results on different PHP versions (e.g., php-cs-fixer behavior varies by PHP version)

The test job correctly specifies PHP versions via a matrix, but the lint job does not.

Location

  • .github/workflows/tests.yaml, line 14–15

Current Code

- name: Setup PHP
  uses: shivammathur/setup-php@v2
  # No php-version specified

Proposed Fix

Pin the PHP version to the project's minimum supported version:

- name: Setup PHP
  uses: shivammathur/setup-php@v2
  with:
    php-version: '8.2'
    tools: composer:v2

Using the minimum supported version (8.2 per composer.json) ensures that lint rules are validated against the lowest common denominator.

Priority

🟢 MINOR — non-deterministic CI behavior; easy fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    code-qualityCode quality improvementsminorMinor priority - code quality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions