Skip to content

Improve Configuration With Multiple PHP / Magento Versions #24

@sprankhub

Description

@sprankhub

Due to the current structure, testing multiple Magento versions on multiple PHP versions is currently not that nice to configure. We only found the following way to do it:

steps:
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.3.5-p2 (PHP 7.3)
    uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.3.5-p2'
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.3.6-p1 (PHP 7.3)
    uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.3.6-p1'
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.4.1-p1 (PHP 7.3)
    uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.4.1-p1'
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.4.2 (PHP 7.3)
    uses: extdn/github-actions-m2/magento-integration-tests/7.3@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.4.2'
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.4.1-p1 (PHP 7.4)
    uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.4.1-p1'
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.4.2 (PHP 7.4)
    uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.4.2'

It contains a lot of duplications, which is not that nice. I would prefer to use the matrix feature of GitHub Actions. However, it is currently not possible to use a matrix value inside the uses section of the step configuration (see e.g. https://github.xiaomo-station.topmunity/t/using-strategy-matrix-values-in-the-specification-of-actions-to-be-used-in-a-workflow/16706). Hence, I think the PHP version should not be referenced in the action name. It should be defined as an option. E.g.:

steps:
  - uses: actions/checkout@v2
  - name: M2 Integration Tests with Magento 2 Version 2.4.2 (PHP 7.4)
    uses: extdn/github-actions-m2/magento-integration-tests@master
    with:
      module_name: Vendor_Module
      composer_name: vendor/module
      ce_version: '2.3.5-p2'
      php_version: '7.4'

If this was possible, we could simply define a matrix, replace ce_version and php_version with the matrix value and we are done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions