Skip to content

Conversation

@michalsn
Copy link
Member

@michalsn michalsn commented Aug 5, 2025

Description
This PR introduces the ability to configure PHP versions across multiple reusable workflow templates.

All workflows now accept a php-versions or php-version input (depending on a workflow template), which allows users to override the default PHP versions used during workflow run. The default values remain unchanged, so existing workflows will continue to work without modification.

To customize the PHP versions in your project, you can now pass the input like this:

jobs:
  example:
    uses: codeigniter4/.github/.github/workflows/example.yml
    with:
      php-versions: '["8.2", "8.4"]'  # Use this for workflows that support multiple PHP versions (matrix)
      # php-version: '8.2'            # Use this if the workflow supports only a single PHP version

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan
Copy link
Member

Just wondering, instead of having the matrix in the reusable workflows, why not have the calling workflows define the matrix strategy? It still feels off to me to write the matrix in pure string. It's counterintuitive to what we do normally with the matrix.

For reference, look at the main repo for the test-phpunit and its underlying reusable workflow.

@michalsn
Copy link
Member Author

michalsn commented Aug 6, 2025

Hmm... yes, that would probably be a much better approach - but it would introduce a BC break.

The question is: do we care about backward compatibility in this case or not?
I've never actually asked this before, but is this repo intended for internal use only, or is it also meant for external/public use?

From what I understand, kenjis started branch CI45 for compatibility. Then I continued with CI46 to support the current version of the framework (change of PHP versions and dependencies), while we're still maintaining the main branch as well.

So I'm not against making changes - I just want to make sure we're on the same page about how things are supposed to work.

@paulbalandan
Copy link
Member

From what I know and I asked chatgpt to confirm, files defined in this repo can also be used by other repos within the same org. So, this is for internal use only.

@michalsn
Copy link
Member Author

michalsn commented Aug 6, 2025

Okay, I will try to come back with an improved version as you suggested - maybe tomorrow.

@michalsn michalsn marked this pull request as draft August 6, 2025 18:12
@michalsn michalsn closed this Aug 14, 2025
@michalsn michalsn deleted the feat/configurable-php-version branch August 14, 2025 12:31
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.

2 participants