GitHub Actions for Magento 2 Extensions

Overview

GitHub Actions for Magento 2 Extensions

This repository's aim is to provide a set of open sourced GitHub actions to write better tested Magento 2 extensions.

Available Actions

Magento Coding Standard

Provides an action that can be used in your GitHub workflow to execute the latest Magento Coding Standard.

Screenshot

Screenshot Coding Style Action

How to use it

In your GitHub repository add the below as .github/workflows/coding-standard.yml

name: ExtDN M2 Coding Standard
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  static:
    name: M2 Coding Standard
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-coding-standard@master

Magento Integration tests

Run your Magento 2 integration tests via this Github Action. All you need is to add your tests. This action will set up the needed Magento services and set up. Please note this action will perform a Composer installation so will provide additional confirmation that this works as well.

Screenshot

Screenshot Mess Detector Action

How to use it

In your GitHub repository add the below as .github/workflows/integration.yml

name: ExtDN M2 Integration Tests
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  integration-tests:
    name: Magento 2 Integration Tests
    runs-on: ubuntu-latest
    services:
      mysql:
        image: mysql:5.7
        env:
          MYSQL_ROOT_PASSWORD: root
        ports:
          - 3306:3306
        options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
      es:
        image: docker.io/wardenenv/elasticsearch:7.8
        ports:
          - 9200:9200
        env:
          'discovery.type': single-node
          'xpack.security.enabled': false
          ES_JAVA_OPTS: "-Xms64m -Xmx512m"
        options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
    steps:
      - uses: actions/checkout@v2
      - name: M2 Integration Tests with Magento 2 (Php7.4)
        uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
        with:
          module_name: Foo_Bar
          composer_name: foo/magento2-foobar
          ce_version: '2.4.0'

The following images are provided for use

Php Image
7.4 extdn/github-actions-m2/magento-integration-tests/7.4@master
7.3 extdn/github-actions-m2/magento-integration-tests/7.3@master
7.2 extdn/github-actions-m2/magento-integration-tests/7.2@master

The following inputs are required:

with description
module_name Your Magento module name. Example: Foo_Bar
composer_name Your composer name. Example: foo/magento2-bar
ce_version Magento 2 Open Source version number. Example: 2.4.0

The default phpunit.xml configuration will check the following folders for *Test files:

  • Test/Integration
  • tests/Integration
  • tests/integration

If this phpunit file does not work for you can provide a relative path to your own PHPUnit file via phpunit_file

      - name: M2 Integration Tests with Magento 2 (Php7.4)
        uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
        with:
          module_name: Foo_Bar
          composer_name: foo/magento2-foobar
          ce_version: '2.4.0'
          phpunit_file: './path/to/phpunit.xml'

Sometimes it may be needed to run additional commands before tests can run. For example to add or remove additional dependencies. Use the input magento_pre_install_script to provide a relative path to this script. Example

      - name: M2 Integration Tests with Magento 2 (Php7.4)
        uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
        with:
          module_name: Foo_Bar
          composer_name: foo/magento2-foobar
          ce_version: '2.4.0'
          magento_pre_install_script: './.github/integration-test-setup.sh'

Magento Mess Detector

Provides an action that can be used in your GitHub workflow to execute the PHP Mess Detector rules included in Magento 2 (link).

Screenshot

Screenshot Mess Detector Action

How to use it

In your GitHub repository add the below as .github/workflows/mess-detector.yml

name: ExtDN M2 Mess Detector
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  phpmd:
    name: M2 Mess Detector
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-mess-detector@master

Magento Copy Paste Detector

Provides an action that can be used in your GitHub workflow to execute the PHP Copy Paste Detector rules included in Magento 2 (link).

How to use it

In your GitHub repository add the below as .github/workflows/copy-paste-detector.yml

name: ExtDN M2 Copy Paste Detector
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  phpmd:
    name: M2 Copy Paste Detector
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-copy-paste-detector@master

Magento PHPStan

Provides an action that can be used in your GitHub workflow to execute the PHPStan rules included in Magento 2 (link).

Screenshot

Screenshot PHPStan Action

How to use it

In your GitHub repository add the below as .github/workflows/phpstan.yml

name: ExtDN M2 PHPStan
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  phpstan:
    name: M2 PHPStan
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: extdn/github-actions-m2/magento-phpstan@master
        with:
          composer_name: foo/magento2-foobar

Magento Performance Smoke Test

Provides an action that can be used in your GitHub workflow to execute blackfire.io profiling before and after installing extension code.

How to use it

In your GitHub repository add the below as .github/workflows/performance.yml

- docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -T php-fpm bash -c 'cd /var/www/html/m2 && sudo chown www-data: -R /var/www/html/m2 && ls -al && id && php -f bin/magento setup:install --base-url=http://magento2.test/ --backend-frontname=admin --db-host=mysql --db-name=magento_performance_tests --db-user=root --db-password=123123q [email protected] --admin-password=password1 [email protected] --admin-firstname=firstname --admin-lastname=lastname' - name: Generate Performance Fixtures run: >- docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -T php-fpm bash -c 'cd /var/www/html/m2 && php -f bin/magento setup:performance:generate-fixtures setup/performance-toolkit/profiles/ce/small.xml && php -f bin/magento cache:enable && php -f bin/magento cache:disable block_html full_page' - name: Run Blackfire id: blackfire-baseline run: docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} run blackfire-agent blackfire --json curl http://magento2.test/category-1/category-1-1.html > ${{ github.workspace }}/baseline.json env: BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }} BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }} BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }} BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }} - name: Install Extension run: >- docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -e EXTENSION_BRANCH=${GITHUB_REF#refs/heads/} -T php-fpm bash -c 'cd /var/www/html/m2 && php -f vendor/composer/composer/bin/composer config repo.extension path /var/www/html/extension && php -f vendor/composer/composer/bin/composer require ${{ env.EXTENSION_PACKAGE_NAME }}:dev-$EXTENSION_BRANCH#${{ github.sha }} && php -f bin/magento module:enable ${{ env.EXTENSION_NAME }} && php -f bin/magento setup:upgrade && php -f bin/magento cache:enable && php -f bin/magento cache:disable block_html full_page' - name: Run Blackfire Again id: blackfire-after run: docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} run blackfire-agent blackfire --json curl http://magento2.test/category-1/category-1-1.html > ${{ github.workspace }}/after.json env: BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }} BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }} BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }} BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }} - name: Compare Performance Results uses: extdn/github-actions-m2/magento-performance-compare@master">
name: ExtDN M2 Performance Testing
on:
  push:
    branches:
      - master
  pull_request:

jobs:
  performance:
    name: M2 Performance Testing
    runs-on: ubuntu-latest
    env:
      DOCKER_COMPOSE_FILE: "./docker-compose.yml"
      EXTENSION_NAME: "Foo_Bar"
      EXTENSION_PACKAGE_NAME: "foo/magento2-foobar"

    steps:
      - uses: actions/checkout@v2
        name: Checkout files
        with:
          path: extension

      - name: Get composer cache directory
        id: composer-cache
        run: "echo \"::set-output name=dir::$(composer config cache-dir)\""
        working-directory: ./extension

      - name: Cache dependencies
        uses: actions/cache@v1
        with:
          path: ${{ steps.composer-cache.outputs.dir }}
          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
          restore-keys: ${{ runner.os }}-composer-

      - name: Prepare ExtDN performance testing
        uses: extdn/github-actions-m2/magento-performance-setup@master
        env:
          BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
          BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
          BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
          BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}

      - name: Install Magento
        run: >-
          docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -T php-fpm
          bash -c 'cd /var/www/html/m2 && sudo chown www-data: -R /var/www/html/m2 && ls -al && id
          && php -f bin/magento setup:install --base-url=http://magento2.test/ --backend-frontname=admin --db-host=mysql --db-name=magento_performance_tests --db-user=root --db-password=123123q [email protected] --admin-password=password1 [email protected] --admin-firstname=firstname --admin-lastname=lastname'
      - name: Generate Performance Fixtures
        run: >-
          docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -T php-fpm
          bash -c 'cd /var/www/html/m2
          && php -f bin/magento setup:performance:generate-fixtures setup/performance-toolkit/profiles/ce/small.xml
          && php -f bin/magento cache:enable
          && php -f bin/magento cache:disable block_html full_page'
      - name: Run Blackfire
        id: blackfire-baseline
        run: docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} run blackfire-agent blackfire --json curl http://magento2.test/category-1/category-1-1.html > ${{ github.workspace }}/baseline.json
        env:
          BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
          BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
          BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
          BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}

      - name: Install Extension
        run: >-
          docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} exec -e EXTENSION_BRANCH=${GITHUB_REF#refs/heads/} -T php-fpm
          bash -c 'cd /var/www/html/m2
          && php -f vendor/composer/composer/bin/composer config repo.extension path /var/www/html/extension
          && php -f vendor/composer/composer/bin/composer require ${{ env.EXTENSION_PACKAGE_NAME }}:dev-$EXTENSION_BRANCH#${{ github.sha }}
          && php -f bin/magento module:enable ${{ env.EXTENSION_NAME }}
          && php -f bin/magento setup:upgrade
          && php -f bin/magento cache:enable
          && php -f bin/magento cache:disable block_html full_page'
      - name: Run Blackfire Again
        id: blackfire-after
        run: docker-compose -f ${{ env.DOCKER_COMPOSE_FILE }} run blackfire-agent blackfire --json curl http://magento2.test/category-1/category-1-1.html > ${{ github.workspace }}/after.json
        env:
          BLACKFIRE_CLIENT_ID: ${{ secrets.BLACKFIRE_CLIENT_ID }}
          BLACKFIRE_CLIENT_TOKEN: ${{ secrets.BLACKFIRE_CLIENT_TOKEN }}
          BLACKFIRE_SERVER_ID: ${{ secrets.BLACKFIRE_SERVER_ID }}
          BLACKFIRE_SERVER_TOKEN: ${{ secrets.BLACKFIRE_SERVER_TOKEN }}

      - name: Compare Performance Results
        uses: extdn/github-actions-m2/magento-performance-compare@master

Change these environment variables:

EXTENSION_NAME: "Foo_Bar"
EXTENSION_PACKAGE_NAME: "foo/magento2-foobar"

Additionally please create the following Github Secrets for this repository with the values available in your blackfire.io account:

BLACKFIRE_CLIENT_ID
BLACKFIRE_CLIENT_TOKEN
BLACKFIRE_SERVER_ID
BLACKFIRE_SERVER_TOKEN

Magento Marketplace repository

With various of the GitHub Actions, you will need to setup Magento, with all of its packages. Normally, you would use the official Magento Marketplace for this, which also requires you to setup authentication.

Amongst the environment variables, there is a variable REPOSITORY_URL which defaults - when kept empty - to https://repo-magento-mirror.fooman.co.nz/ - a mirror of the Magento Marketplace, that removes the need of authentication.

If you want to use the original Magento Marketplace anyway, reset the REPOSITORY_URL variable and add the marketplace credentials like this:

jobs:
  unit-tests:
    env:
      REPOSITORY_URL: https://repo.magento.com/
      MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }}
      MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }}

Next, make sure to add the secrets MAGENTO_MARKETPLACE_USERNAME and MAGENTO_MARKETPLACE_PASSWORD to your GitHub repository under Settings > Secrets. Tip: You could also use the secrets to define the module and composer name: This way your workflow file remains generic.

Alternatively, the credentials could also be hard-coded :(

jobs:
  unit-tests:
    env:
      MAGENTO_MARKETPLACE_USERNAME: foo
      MAGENTO_MARKETPLACE_PASSWORD: bar
Comments
  • feat: allow configuration of composer version in integration tests

    feat: allow configuration of composer version in integration tests

    This PR provides a way to configure the composer version used in integration tests.

    Composer 2 was only installed in the Dockerfile for 7.4 so I added the config option only there. IIRC composer 2 requires 7.4? (or at least 7.3?)

    opened by kolaente 7
  • Monolog 2.7 causes breaking changes that make Integration Tests fail

    Monolog 2.7 causes breaking changes that make Integration Tests fail

    In my environment, Magento 2.4.4 with PHP 8.1 causes the installation of Monolog 2.7, which again has changed method signatures that are used by the Magento TestFramework to log stuff. This issue is reported at Magento here: https://github.com/magento/magento2/issues/35720

    The workaround is to add composer require monolog/monolog:2.6.0 somewhere to the Integration Tests, right before doing a composer install. I've personally added it to a pre-install script.

    Anyone else bumping into this? If so, I might simply add it to the GitHub Action here instead.

    opened by jissereitsma 6
  • Newer PHPUnit versions don't allow for non-existing directories in testsuites

    Newer PHPUnit versions don't allow for non-existing directories in testsuites

    In the phpunit.xml file shipped with the ExtDN Integration Tests, there are multiple different directories mentioned for the testsuite. In my personal case, the first folder matches my tests. The other ones are simply included "just in case".

        <testsuites>
            <testsuite name="IntegrationTests">
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/Test/Integration</directory>
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/Integration</directory>
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/integration</directory>
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/Test/Integration</directory>
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/tests/Integration</directory>
                <directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/tests/integration</directory>
            </testsuite>
        </testsuites>
    

    Unfortunately, newer versions of PHPUnit (todo: which ones? well, newer ones, at least with Magento 2.4.4 under PHP 8.1) give a failure when one of these folders is missing. My solution is now to use the PHPUNIT_FILE input or env variables to bring in a new PHUnit file where I remove all non-relevant files. But this is getting annoying.

    One possible (breaking) fix would be to let go of the testsuites entirely, simply passing the sources to PHPUnit as an argument. In entrypoint.sh this would change the following last line:

    cd $MAGENTO_ROOT/dev/tests/integration && ../../../vendor/bin/phpunit -c phpunit.xml
    

    to:

    cd $MAGENTO_ROOT/dev/tests/integration && ../../../vendor/bin/phpunit -c phpunit.xml $GITHUB_WORKSPACE
    

    Another fix would be to remove all lines except the top one. but this would break at least the workflow of @fooman .

    Yet another fix would be to make it simpler to override the PHPUnit file. Instead of requiring the PHPUnit variable to be defined in your workflow, we could simply check for a relevant file in the .github/workflows/ folder. But that sounds a bit too magical for me.

    opened by jissereitsma 5
  • static code analysis with the PHPCompatibility Coding Standard

    static code analysis with the PHPCompatibility Coding Standard

    Apologies I'm on a windows machine at the moment so can't fully test this e.g can't even clone repo due to file naming convention. And can only do so much using WSL.

    So basically I've taken a wild stab in the dark on how I think this should work. Could need further work. Also what that means is that I can't do a great deal of editing if changes are required to the PR.

    Personally for me I think it would be really handy to have a static code analysis with the specifically the PHPCompatibility coding standard but allowing adjustment of test version.

    opened by DomPixie 5
  • Cannot use PHP 7.4 action for coding standards

    Cannot use PHP 7.4 action for coding standards

    I'm trying to use PHP 7.4 for the coding standards action with the following yml file

     name: ExtDN M2 Coding Standard
     on:
       push:
         branches:
           - master
       pull_request:
     
     jobs:
       static:
         name: M2 Coding Standard
         runs-on: ubuntu-latest
         steps:
           - uses: actions/checkout@v2
           - uses: extdn/github-actions-m2/magento-coding-standard/7.4@master
    

    Which errors with:

    Pull down action image 'extdn/magento-coding-standard-action:7.4-latest'
      /usr/bin/docker pull extdn/magento-coding-standard-action:7.4-latest
      Error response from daemon: manifest for extdn/magento-coding-standard-action:7.4-latest not found: manifest unknown: manifest unknown
      Warning: Docker pull failed with exit code 1, back off 9.014 seconds before retry.
      /usr/bin/docker pull extdn/magento-coding-standard-action:7.4-latest
      Error response from daemon: manifest for extdn/magento-coding-standard-action:7.4-latest not found: manifest unknown: manifest unknown
      Warning: Docker pull failed with exit code 1, back off 8.851 seconds before retry.
      /usr/bin/docker pull extdn/magento-coding-standard-action:7.4-latest
      Error response from daemon: manifest for extdn/magento-coding-standard-action:7.4-latest not found: manifest unknown: manifest unknown
    Error: Docker pull failed with exit code 1
    

    (without /7.4 it works but cannot parse PHP 7.4 syntax obviously)

    opened by schmengler 5
  • Use composer 2 in the php-7.4 image for faster installation times

    Use composer 2 in the php-7.4 image for faster installation times

    Since Magento 2.4 is the only Magento version that is compatible with php 7.4, I think it would be possible to switch the composer version for the php 7.4 image to version 2 without breaking backwards compatibility.

    This would speedup the installation of Magento and additional packages significantly, and thus make the action a lot faster.

    Please let me know what you think, and if necessary I can make a PR.

    opened by Aimless321 5
  • Magento-phpstan Action: Why do we need a composer package for it? Composer 2.0 is not supported!

    Magento-phpstan Action: Why do we need a composer package for it? Composer 2.0 is not supported!

    Hi, thank you for your great works here. I would like to have 2 questions:

    1. Why do we need a composer package for it?
    2. Can you pls update a docker? so it can support Composer 2.0. Thank you so much!
    opened by trunglv 4
  • Fix issue with memory helper in early 2.3

    Fix issue with memory helper in early 2.3

    There are a couple of M2 core issues

    2.3.0 is broken due to

    In Filesystem.php line 156:
    
      [Magento\Framework\Exception\LocalizedException]
      The XML in file "/tmp/m2/vendor/magento/module-inventory-catalog/etc/commun
      ication.xml" is invalid:
      Element 'topic', attribute 'is_synchronous': The attribute 'is_synchronous'
       is not allowed.
      Line: 9
    
      Element 'topic', attribute 'is_synchronous': The attribute 'is_synchronous'
       is not allowed.
      Line: 12
    
      Element 'topic', attribute 'is_synchronous': The attribute 'is_synchronous'
       is not allowed.
      Line: 15
    
      Element 'topic', attribute 'is_synchronous': The attribute 'is_synchronous'
       is not allowed.
      Line: 18
    
      Element 'topic', attribute 'is_synchronous': The attribute 'is_synchronous'
       is not allowed.
      Line: 21
    
      Verify the XML and try again.
    

    see https://github.com/extdn/extension-dashboard-m2/runs/1312019553?check_suite_focus=true

    2.3.1 - 2.3.3 broken due to

    OK (4 tests, 5 assertions)
    
    Fatal error: Uncaught PHPUnit\Framework\Exception: Notice: Undefined variable: e in /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Helper/Memory.php:52.
    
    /tmp/m2/dev/tests/integration/framework/bootstrap.php:134
    /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Helper/Memory.php:52
    /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/MemoryLimit.php:127
    /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/MemoryLimit.php:59
    /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Bootstrap/Memory.php:50
    
      thrown in /tmp/m2/dev/tests/integration/framework/bootstrap.php on line 134
    

    https://github.com/extdn/extension-dashboard-m2/runs/1312039797?check_suite_focus=true

    see https://github.com/extdn/extension-dashboard-m2/runs/1312423133?check_suite_focus=true

    wontfix 
    opened by fooman 4
  • Add PHP 8.1 support for PHPStan

    Add PHP 8.1 support for PHPStan

    Add PHP version infrastructure similar to the approach with unit tests and integration tests. Add PHP 8.1, following from that. Make sure that the workflows in this repository are also picking up on new commits and/or PRs, so that Docker images are built automatically. Ask @sprankhub to do the work.

    opened by jissereitsma 3
  • Add problem matcher support for PHPMD

    Add problem matcher support for PHPMD

    In the coding-standard action, support for problem matcher has been added, and when creating a pull request, all the problems found are highlighted when viewing the execution result, as well as when viewing the pull request itself. The found problems that were not affected by the new changes are also displayed.

    image

    image

    image

    But when viewing the result of the execution of PHPMD, we can only see the result of the execution by opening the logs. This is inconvenient, since you need to copy the filepath and search for the desired string.

    image

    image

    Judging by the PHPMD documentation they have an implemented renderer supported by github https://phpmd.org/documentation/index.html#renderers https://phpmd.org/documentation/ci-integration.html#github-actions

    Judging by the code, the text renderer is currently being used, and if it is replaced with "github, then everything should work automatically. https://github.com/extdn/github-actions-m2/blob/master/magento-mess-detector/LiveCodePhpmdRunner.php#L62

    If it doesn't work, then most likely we need to implement an additional problem matcher to support PHPMD, as it is done for Coding Standard https://github.com/extdn/github-actions-m2/blob/master/magento-coding-standard/problem-matcher.json

    opened by DmitryFurs 3
  • docs: prevent Action running twice for PRs from a branch in the repo

    docs: prevent Action running twice for PRs from a branch in the repo

    I've added the examples from the readme to our project and the actions were executed twice for PRs: One time for the push, one time for the branch. This PR updates the docs to make them run by default on either the master branch or a PR but not both.

    opened by kolaente 3
  • Bump @actions/core from 1.2.6 to 1.9.1 in /magento-performance-setup

    Bump @actions/core from 1.2.6 to 1.9.1 in /magento-performance-setup

    Bumps @actions/core from 1.2.6 to 1.9.1.

    Changelog

    Sourced from @​actions/core's changelog.

    1.9.1

    • Randomize delimiter when calling core.exportVariable

    1.9.0

    • Added toPosixPath, toWin32Path and toPlatformPath utilities #1102

    1.8.2

    • Update to v2.0.1 of @actions/http-client #1087

    1.8.1

    • Update to v2.0.0 of @actions/http-client

    1.8.0

    1.7.0

    1.6.0

    1.5.0

    1.4.0

    1.3.0

    1.2.7

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump @actions/core from 1.2.6 to 1.9.1 in /magento-performance-compare

    Bump @actions/core from 1.2.6 to 1.9.1 in /magento-performance-compare

    Bumps @actions/core from 1.2.6 to 1.9.1.

    Changelog

    Sourced from @​actions/core's changelog.

    1.9.1

    • Randomize delimiter when calling core.exportVariable

    1.9.0

    • Added toPosixPath, toWin32Path and toPlatformPath utilities #1102

    1.8.2

    • Update to v2.0.1 of @actions/http-client #1087

    1.8.1

    • Update to v2.0.0 of @actions/http-client

    1.8.0

    1.7.0

    1.6.0

    1.5.0

    1.4.0

    1.3.0

    1.2.7

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump @actions/core from 1.2.6 to 1.9.1 in /install-m2-from-mirror

    Bump @actions/core from 1.2.6 to 1.9.1 in /install-m2-from-mirror

    Bumps @actions/core from 1.2.6 to 1.9.1.

    Changelog

    Sourced from @​actions/core's changelog.

    1.9.1

    • Randomize delimiter when calling core.exportVariable

    1.9.0

    • Added toPosixPath, toWin32Path and toPlatformPath utilities #1102

    1.8.2

    • Update to v2.0.1 of @actions/http-client #1087

    1.8.1

    • Update to v2.0.0 of @actions/http-client

    1.8.0

    1.7.0

    1.6.0

    1.5.0

    1.4.0

    1.3.0

    1.2.7

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Unable to parse fixtures error on Magento 2.4.5

    Unable to parse fixtures error on Magento 2.4.5

    Running github action on Magento 2.4.5 fails and shows the following error:

    Unable to parse fixtures
    #0 /tmp/m2/local-source/__extdn_github-actions-m2_7/Test/Integration/Console/Command/Tax/Rates/EditCommandTest.php(52): CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest->testExecuteWithoutTitles()
    
    Caused By: Call to undefined method ReflectionMethod::getAttributes()
    #0 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/Parser/Composite.php(47): Magento\TestFramework\Fixture\Parser\IndexerDimensionMode->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest), 'method')
    #1 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/IndexerDimensionMode.php(165): Magento\TestFramework\Annotation\Parser\Composite->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest), 'method')
    #2 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/IndexerDimensionMode.php(105): Magento\TestFramework\Annotation\IndexerDimensionMode->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
    #3 [internal function]: Magento\TestFramework\Annotation\IndexerDimensionMode->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
    #4 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/EventManager.php(49): call_user_func_array(Array, Array)
    #5 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php(127): Magento\TestFramework\EventManager->fireEvent('startTest', Array)
    #6 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestResult.php(438): Magento\TestFramework\Event\PhpUnit->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
    #7 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestResult.php(661): PHPUnit\Framework\TestResult->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
    #8 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestCase.php(903): PHPUnit\Framework\TestResult->run(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
    #9 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
    #10 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    #11 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    #12 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(673): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
    #13 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/Command.php(143): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
    #14 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command->run(Array, true)
    #15 phpvfscomposer:///tmp/m2/vendor/phpunit/phpunit/phpunit(97): PHPUnit\TextUI\Command::main()
    #16 /tmp/m2/vendor/bin/phpunit(118): include('phpvfscomposer:...')
    #17 {main}
    

    The whole log can be seen here: https://github.com/customgento/module-cli-tax-editor-m2/runs/7898194786?check_suite_focus=true

    One thing i noticed is that the phpunit.xml file for the actions is a bit outdated compared to the phpunit.xml file in Magento 2.4.5

    Strangely enough, the issue can't be reproduced locally (even when https://github.com/extdn/github-actions-m2/blob/master/magento-integration-tests/docker-files/phpunit.xml is added to the local instance)

    opened by BorisovskiP 2
  • Missing Env Variables

    Missing Env Variables

    As part of https://github.com/extdn/github-actions-m2/pull/69, we encountered that there are quite some input variables, which are not passed into the Docker container. https://github.com/extdn/github-actions-m2/blob/4091e3ae8e47b4fdaa049a9c64a088c1d06d02f1/magento-integration-tests/entrypoint.sh uses the following inputs, which are not passed into the Docker container here:

    https://github.com/extdn/github-actions-m2/blob/4091e3ae8e47b4fdaa049a9c64a088c1d06d02f1/magento-integration-tests/8.1/action.yml#L44-L49

    • INPUT_ELASTICSEARCH
    • INPUT_PHPUNIT_FILE
    • INPUT_COMPOSER_VERSION
    • INPUT_REPOSITORY_URL
    • INPUT_PRE_PROJECT_SCRIPT
    • INPUT_POST_PROJECT_SCRIPT
    • INPUT_MAGENTO_PRE_INSTALL_SCRIPT
    • INPUT_MAGENTO_POST_INSTALL_SCRIPT

    Wouldn't all these variables need to be passed as well? Am I missing something?

    /cc @jissereitsma

    opened by sprankhub 5
  • [BUG] Magento 2 Tests Integration tests fail unless the key USE_OVERRIDE_CONFIG is set to enabled in `phpunit.xml`

    [BUG] Magento 2 Tests Integration tests fail unless the key USE_OVERRIDE_CONFIG is set to enabled in `phpunit.xml`

    See the phpunit.xml.dist

    To be perfectly honest, this configuration setting is beyond me. I spent an hour with @MateusDadalto (after he spent a whole day) trying to understand this configuration settings purpose is.

    In short, it looks like during a test run in dev/tests/integration in v2.4.3, Magento installs some modules into app/code/Magento.

    After test cleanup

    1. These extraneous test module files are deleted
    2. Magento also triggers a session_close 3 session_close triggers a native Magento 2 plugin to retrieve a value from ScopeConfigInterface
    3. getValue triggers a config merge
    4. Config merge does a fopen on a now deleted file app/code/Magento/TestModuleFakePaymentMethod/etc/config.xml
    Fatal error: Uncaught Magento\Framework\Exception\FileSystemException: The "/tmp/m2/app/code/Magento/TestModuleFakePaymentMethod/etc/config.xml" file doesn't exist. in /tmp/m2/vendor/magento/framework/Filesystem/File/Read.php:76
    Stack trace:
    #0 /tmp/m2/vendor/magento/framework/Filesystem/File/Read.php(62): Magento\Framework\Filesystem\File\Read->assertValid()
    #1 /tmp/m2/vendor/magento/framework/Filesystem/File/Read.php(52): Magento\Framework\Filesystem\File\Read->open()
    #2 /tmp/m2/vendor/magento/framework/Filesystem/File/ReadFactory.php(45): Magento\Framework\Filesystem\File\Read->__construct('/tmp/m2/app/cod...', Object(Magento\Framework\Filesystem\Driver\File))
    #3 /tmp/m2/vendor/magento/framework/Config/FileIterator.php(70): Magento\Framework\Filesystem\File\ReadFactory->create('/tmp/m2/app/cod...', 'file')
    #4 /tmp/m2/vendor/magento/framework/App/Config/Initial/Reader.php(93): Magento\Framework\Config\FileIterator->current()
    #5 /tmp/m2/vendor/magento/module-config/App/Config/Source/ModularConfigSource.php(42): Magento\F in /tmp/m2/vendor/magento/framework/Filesystem/File/Read.php on line 76
    

    Regardless, we need the USE_OVERRIDE_CONFIG in the phpunit.xml because of reasons.

    opened by damienwebdev 1
Owner
ExtDN
We are a network of leading Magento extension developers who share a common vision for a thriving Magento ecosystem with the merchant's success at heart.
ExtDN
This package is aimed to be a simplistic PHP workflow package that works in a similar fashion to GitHub Actions.

Workflow This package is aimed to be a simplistic PHP workflow package that works in a similar fashion to GitHub Actions. Installation To install this

Steve McDougall 4 Sep 26, 2022
The tool converts different error reporting standards for deep compatibility with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc).

JBZoo / CI-Report-Converter Why? Installing Using as GitHub Action Example GitHub Action workflow Available Directions Help description in terminal Co

JBZoo Toolbox 17 Jun 16, 2022
This repository aims to build a fairly complete CI/CD example using GitHub workflows and actions.

CI/CD example This repository aims to build a fairly complete CI/CD example using GitHub workflows and actions. Keep in mind that the toolset used in

Robin Ingelbrecht 4 Nov 1, 2022
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.

Shivam Mathur 2.4k Jan 6, 2023
Run your WP site on github pages, php innovation award winner https://www.phpclasses.org/package/12091-PHP-Make-a-WordPress-site-run-on-GitHub-pages.html

Gitpress Run wordpress directly on github pages Gitpress won the innovation award for may 2021 Read more about this https://naveen17797.github.io/gitp

naveen 13 Nov 18, 2022
Modularize extensions using symlinks. Voted #1 Magento tool by @WebShopApps!

modman (Module Manager) Developing extensions for software that doesn't allow you to separate your files from core files, and keeping that extension u

Colin Mollenhour 731 Dec 29, 2022
A Magento 2 dashboard to display installed extensions. Read the blog post on some of the thinking behind it:

Extension Dashboard for Magento 2 This module adds a dashboard to review all installed extensions in the Magento admin (Magento 2.3.0+ for now only).

ExtDN 36 Dec 24, 2022
List of Magento extensions with known security issues.

Magento Vulnerability Database List of Magento 1 and 2 integrations with known security issues. Objective: easily identify insecure 3rd party software

Sansec 184 Dec 7, 2022
Actions: controller + auth + validation in one class

Actions: controller + auth + validation in one class This package provides only one class: an Action class that extends the FormRequest class we all k

edatta 2 Dec 15, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Helper to automatically load various Kirby extensions in a plugin

Autoloader for Kirby Helper to automatically load various Kirby extensions in a plugin Commerical Usage This package is free but if you use it in a co

Bruno Meilick 13 Nov 9, 2022
Zephir is a compiled high level language aimed to the creation of C-extensions for PHP.

Zephir - is a high level programming language that eases the creation and maintainability of extensions for PHP. Zephir extensions are exported to C c

Zephir Language 3.2k Jan 2, 2023
Custom code snippets and examples for SkyVerge-built WooCommerce extensions

SkyVerge WooCommerce Plugins Welcome to the wc-plugins-snippets repository! This repository stores code snippets related to SkyVerge WooCommerce plugi

SkyVerge 255 Nov 16, 2022
Library to build PHP extensions with C++

PHP-CPP The PHP-CPP library is a C++ library for developing PHP extensions. It offers a collection of well documented and easy-to-use classes that can

Copernica 1.3k Dec 24, 2022
PhpCodeAnalyzer scans codebase and analyzes which non-built-in php extensions used

PhpCodeAnalyzer PhpCodeAnalyzer finds usage of different non-built-in extensions in your php code. This tool helps you understand how transportable yo

Sergey 92 Oct 19, 2022
Silverstripe-ideannotator - Generate docblocks for DataObjects, Page, PageControllers and (Data)Extensions

silverstripe-ideannotator This module generates @property, @method and @mixin tags for DataObjects, PageControllers and (Data)Extensions, so ide's lik

SilverLeague 44 Dec 21, 2022
A simple script to convert extensions from Magento1 to Magento2

ConvertM1M2 Background The purpose of this script is to automate as much as possible the initial conversion of a Magento 1 extension, and allow develo

Boris Gurvich 144 Dec 14, 2022