From 60625da048c94380e211d6ba12d06a204750cac8 Mon Sep 17 00:00:00 2001 From: Michiel Gerritsen Date: Mon, 3 Feb 2025 10:37:05 +0100 Subject: [PATCH] Improvement: Increase used GitHub Actions levels and test stability --- .github/workflows/codeql.yml | 2 +- .github/workflows/codesniffer.yml | 2 +- .github/workflows/end-2-end-test.yml | 8 +++--- .github/workflows/integration-test.yml | 9 +++++-- .github/workflows/phpstan.yml | 4 +-- .github/workflows/setup-di-compile.yml | 37 -------------------------- .github/workflows/unit-test.yml | 5 ++-- 7 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 .github/workflows/setup-di-compile.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e72434d6ef0..7c5c512d2ae 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index 7dcba7f4de7..7c70cf3d866 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -5,7 +5,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run codesniffer run: diff --git a/.github/workflows/end-2-end-test.yml b/.github/workflows/end-2-end-test.yml index 6bc936d8f5a..a1e478c5079 100644 --- a/.github/workflows/end-2-end-test.yml +++ b/.github/workflows/end-2-end-test.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Remove run E2E tests label - uses: actions/github-script@v5 + uses: actions/github-script@v7 with: script: | github.rest.issues.removeLabel({ @@ -74,7 +74,7 @@ jobs: CYPRESS_TESTRAIL_RUN_NAME: "Github Workflow, ${{ github.head_ref || github.ref_name }}, PHP version: ${{ matrix.PHP_VERSION }}, Magento version: ${{ matrix.MAGENTO_VERSION }}" CYPRESS_TESTRAIL_RUN_CLOSE: true steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Start the Magento container run: | @@ -135,10 +135,10 @@ jobs: docker compose -f .github/workflows/templates/docker-compose.yml logs e2e > e2e.log - name: Upload artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: - name: E2E logs - ${{ matrix.PHP_VERSION }} - ${{ matrix.MAGENTO_VERSION }} + name: E2E logs - ${{ matrix.PHP_VERSION }} - ${{ matrix.MAGENTO_VERSION }} - API ${{ matrix.NO_API_KEY_TEST }} path: | Test/End-2-end/cypress/videos Test/End-2-end/cypress/screenshots diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 0943c659387..3bb872a1479 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: build: strategy: + fail-fast: false matrix: include: - PHP_VERSION: php73-fpm @@ -18,7 +19,7 @@ jobs: MAGENTO_VERSION: 2.4.7 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Start Docker run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} @@ -30,7 +31,11 @@ jobs: run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev - name: Activate the extension - run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated" + run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade" + + - name: Set developer mode for 2.3.7 and 2.4.0 + if: ${{ matrix.MAGENTO_VERSION == '2.3.7-p4' || matrix.MAGENTO_VERSION == '2.4.0' }} + run: docker exec magento-project-community-edition ./retry "php bin/magento deploy:mode:set developer" - name: Run tests run: docker exec magento-project-community-edition bash -c "cd /data/dev/tests/integration/ && /data/vendor/bin/phpunit -c /data/dev/tests/integration/phpunit.xml" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index b637cc025bf..985cfdef6c7 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Start Docker run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} @@ -37,7 +37,7 @@ jobs: run: docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev - name: Activate the extension - run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated && php bin/magento setup:di:compile" + run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:di:compile && php bin/magento setup:upgrade --keep-generated" - name: Run PHPStan continue-on-error: ${{ matrix.PHPSTAN_LEVEL == 2 }} diff --git a/.github/workflows/setup-di-compile.yml b/.github/workflows/setup-di-compile.yml deleted file mode 100644 index 7766b7157c9..00000000000 --- a/.github/workflows/setup-di-compile.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: setup:di:compile -on: [push, pull_request] - -jobs: - build: - strategy: - matrix: - include: - - PHP_VERSION: php73-fpm - MAGENTO_VERSION: 2.3.7-p4 - - PHP_VERSION: php74-fpm - MAGENTO_VERSION: 2.4.0 - - PHP_VERSION: php74-fpm - MAGENTO_VERSION: 2.4.3-with-replacements - - PHP_VERSION: php81-fpm - MAGENTO_VERSION: 2.4.6-p4 - - PHP_VERSION: php83-fpm - MAGENTO_VERSION: 2.4.7 - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - name: Start Docker - run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} - - - name: Remove version from composer.json - run: sed -i '/version/d' ./composer.json - - - name: Upload our code into the docker container - run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ - - - name: Install the extension in Magento - run: docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev - - - name: Run setup:di:compile - run: docker exec magento-project-community-edition ./retry "php bin/magento setup:di:compile" diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 966fe3774f4..bbffc02e59e 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -4,6 +4,7 @@ on: [push, pull_request] jobs: build: strategy: + fail-fast: false matrix: include: - PHP_VERSION: php73-fpm @@ -18,7 +19,7 @@ jobs: MAGENTO_VERSION: 2.4.7 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Start Docker run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }} @@ -30,7 +31,7 @@ jobs: run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev - name: Activate the extension - run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade --keep-generated && php bin/magento setup:di:compile" + run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade && php bin/magento setup:di:compile" - name: Run tests run: docker exec magento-project-community-edition bash -c "vendor/bin/phpunit extensions/*/Test/Unit"