|
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + pull_request: |
| 7 | + branches: [ master ] |
| 8 | + |
| 9 | +jobs: |
| 10 | +# disabled because MAGENTO_MARKETPLACE_USERNAME and MAGENTO_MARKETPLACE_PASSWORD repository secrets do not work: |
| 11 | +########### |
| 12 | +# phpstan: |
| 13 | +# |
| 14 | +# name: PHPStan Static Analysis |
| 15 | +# runs-on: ubuntu-latest |
| 16 | +# |
| 17 | +# steps: |
| 18 | +# - uses: actions/checkout@v2 |
| 19 | +# |
| 20 | +# - name: Setup PHP |
| 21 | +# uses: shivammathur/setup-php@v2 |
| 22 | +# with: |
| 23 | +# php-version: '8.1' |
| 24 | +# |
| 25 | +# - name: Validate composer.json and composer.lock |
| 26 | +# run: composer validate --strict |
| 27 | +# |
| 28 | +# - name: Cache Composer packages |
| 29 | +# id: composer-cache |
| 30 | +# uses: actions/cache@v2 |
| 31 | +# with: |
| 32 | +# path: vendor |
| 33 | +# key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} |
| 34 | +# restore-keys: | |
| 35 | +# ${{ runner.os }}-php- |
| 36 | +# |
| 37 | +# - name: Install dependencies |
| 38 | +# run: composer global config http-basic.repo.magento.com ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }} ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }} && composer install --prefer-dist --no-progress |
| 39 | +# |
| 40 | +# - name: Run PHPStan |
| 41 | +# run: vendor/bin/phpstan --no-progress |
| 42 | + |
| 43 | + # cannot parameterize php version because of different ext-dn actions per version |
| 44 | + integration-tests-74: |
| 45 | + name: Magento 2 Integration Tests (php 7.4) |
| 46 | + runs-on: ubuntu-latest |
| 47 | + |
| 48 | + strategy: |
| 49 | + matrix: |
| 50 | + magento-version: [2.3, 2.4] |
| 51 | + include: |
| 52 | + - magento-version: 2.3 |
| 53 | + magento-patch-version: 2.3.7 |
| 54 | + - magento-version: 2.4 |
| 55 | + magento-patch-version: 2.4.4 |
| 56 | + |
| 57 | + services: |
| 58 | + mysql: |
| 59 | + image: mysql:5.7 |
| 60 | + env: |
| 61 | + MYSQL_ROOT_PASSWORD: root |
| 62 | + ports: |
| 63 | + - 3306:3306 |
| 64 | + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 65 | + es: |
| 66 | + image: docker.io/wardenenv/elasticsearch:7.8 |
| 67 | + ports: |
| 68 | + - 9200:9200 |
| 69 | + env: |
| 70 | + 'discovery.type': single-node |
| 71 | + 'xpack.security.enabled': false |
| 72 | + ES_JAVA_OPTS: "-Xms64m -Xmx512m" |
| 73 | + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v2 |
| 76 | + - name: M2 Integration Tests with Magento 2 |
| 77 | + uses: extdn/github-actions-m2/magento-integration-tests/7.4@master |
| 78 | + with: |
| 79 | + module_name: TddWizard_Fixtures |
| 80 | + composer_name: tddwizard/magento2-fixtures |
| 81 | + composer_version: 2 |
| 82 | + ce_version: ${{ matrix.magento-patch-version }} |
| 83 | + phpunit_file: .github/phpunit9-integration.xml |
| 84 | + - name: Upload Integration Test Results |
| 85 | + if: always() |
| 86 | + uses: actions/upload-artifact@v2 |
| 87 | + with: |
| 88 | + name: Integration Test Results |
| 89 | + # filename is defined in phpunit9-integration.xml |
| 90 | + # since it's the same every time, only one integration test result is published |
| 91 | + path: var/test-results/integration.xml |
| 92 | + integration-tests-81: |
| 93 | + name: Magento 2 Integration Tests (PHP 8.1) |
| 94 | + runs-on: ubuntu-latest |
| 95 | + |
| 96 | + strategy: |
| 97 | + matrix: |
| 98 | + magento-version: [2.4] |
| 99 | + include: |
| 100 | + - magento-version: 2.4 |
| 101 | + magento-patch-version: 2.4.4 |
| 102 | + |
| 103 | + services: |
| 104 | + mysql: |
| 105 | + image: mysql:5.7 |
| 106 | + env: |
| 107 | + MYSQL_ROOT_PASSWORD: root |
| 108 | + ports: |
| 109 | + - 3306:3306 |
| 110 | + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 111 | + es: |
| 112 | + image: docker.io/wardenenv/elasticsearch:7.8 |
| 113 | + ports: |
| 114 | + - 9200:9200 |
| 115 | + env: |
| 116 | + 'discovery.type': single-node |
| 117 | + 'xpack.security.enabled': false |
| 118 | + ES_JAVA_OPTS: "-Xms64m -Xmx512m" |
| 119 | + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 120 | + steps: |
| 121 | + - uses: actions/checkout@v2 |
| 122 | + - name: M2 Integration Tests with Magento 2 |
| 123 | + uses: extdn/github-actions-m2/magento-integration-tests/7.4@master |
| 124 | + with: |
| 125 | + module_name: TddWizard_Fixtures |
| 126 | + composer_name: tddwizard/magento2-fixtures |
| 127 | + composer_version: 2 |
| 128 | + ce_version: ${{ matrix.magento-patch-version }} |
| 129 | + phpunit_file: .github/phpunit9-integration.xml |
| 130 | + - name: Upload Integration Test Results |
| 131 | + if: always() |
| 132 | + uses: actions/upload-artifact@v2 |
| 133 | + with: |
| 134 | + name: Integration Test Results |
| 135 | + path: var/test-results/integration.xml |
| 136 | + |
| 137 | + publish-test-results: |
| 138 | + name: "Publish Tests Results" |
| 139 | + needs: |
| 140 | + - integration-tests-74 |
| 141 | + - integration-tests-81 |
| 142 | + runs-on: ubuntu-latest |
| 143 | + if: always() |
| 144 | + |
| 145 | + steps: |
| 146 | + - name: Download Artifacts |
| 147 | + uses: actions/download-artifact@v2 |
| 148 | + with: |
| 149 | + path: artifacts |
| 150 | + |
| 151 | + - name: Publish Test Results |
| 152 | + uses: EnricoMi/publish-unit-test-result-action@v1 |
| 153 | + with: |
| 154 | + files: artifacts/**/*.xml |
0 commit comments