Skip to content

Commit 639aca8

Browse files
authored
Merge pull request #76 from tddwizard/php81
Php81
2 parents 82bcafd + 967c51c commit 639aca8

File tree

5 files changed

+208
-112
lines changed

5 files changed

+208
-112
lines changed

.github/phpunit9-integration.xml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.2/phpunit.xsd"
4+
colors="true"
5+
columns="max"
6+
beStrictAboutTestsThatDoNotTestAnything="false"
7+
bootstrap="./framework/bootstrap.php"
8+
stderr="true"
9+
>
10+
<testsuites>
11+
<testsuite name="IntegrationTests">
12+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests</directory>
13+
</testsuite>
14+
</testsuites>
15+
<filter>
16+
<whitelist>
17+
<exclude>
18+
<directory>../../../lib/internal/*/*/Test</directory>
19+
<directory>../../../lib/internal/*/*/*/Test</directory>
20+
<directory>../../../setup/src/*/*/Test</directory>
21+
<directory>../../../vendor/*/*/Test</directory>
22+
</exclude>
23+
</whitelist>
24+
</filter>
25+
<php>
26+
<includePath>.</includePath>
27+
<includePath>testsuite</includePath>
28+
<ini name="date.timezone" value="America/Los_Angeles"/>
29+
<ini name="xdebug.max_nesting_level" value="200"/>
30+
<ini name="memory_limit" value="-1"/>
31+
<const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/>
32+
<const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/>
33+
<const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/>
34+
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
35+
<const name="TESTS_CLEANUP" value="enabled"/>
36+
<const name="TESTS_MEM_USAGE_LIMIT" value="8G"/>
37+
<const name="TESTS_MEM_LEAK_LIMIT" value="0"/>
38+
<const name="TESTS_EXTRA_VERBOSE_LOG" value="1"/>
39+
<const name="TESTS_MAGENTO_MODE" value="developer"/>
40+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
41+
</php>
42+
<listeners>
43+
<listener class="Magento\TestFramework\Event\PhpUnit"/>
44+
<listener class="Magento\TestFramework\ErrorLog\Listener"/>
45+
</listeners>
46+
<logging>
47+
<!-- need to specify absolute path to mounted directory, because Magento is installed in /tmp/m2 -->
48+
<log type="junit" target="/github/workspace/var/test-results/integration.xml"/>
49+
<!-- for phpunit 9.5 change to:
50+
<junit outputFile="/github/workspace/var/test-results/integration.xml"/>
51+
-->
52+
</logging>
53+
</phpunit>

.github/workflows/tests.yml

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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

.travis.yml

-49
This file was deleted.

.travis/before_script.sh

-62
This file was deleted.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
],
3232
"require": {
33-
"php": "^7.1",
33+
"php": "^7.1|^8.0",
3434
"magento/framework": "^102.0|^103.0",
3535
"magento/zendframework1": "^1.14",
3636
"magento/module-catalog": "^103.0|^104.0",

0 commit comments

Comments
 (0)