Skip to content

Commit 5386b95

Browse files
authored
Merge pull request #7 from integer-net/github-actions
Add ExtDn Github Action for tests
2 parents a40c19e + 237d655 commit 5386b95

24 files changed

+385
-354
lines changed

.github/autoload-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sed -i -e 's/"psr-4":/"classmap": ["vendor\/integer-net\/magento2-shippingpreselection\/tests\/"], "psr-4":/' composer.json

.github/phpunit9-integration.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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.1/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%/Test/Integration</directory>
13+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/Integration</directory>
14+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/integration</directory>
15+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/Test/Integration</directory>
16+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/tests/Integration</directory>
17+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/src/tests/integration</directory>
18+
</testsuite>
19+
</testsuites>
20+
<filter>
21+
<whitelist>
22+
<exclude>
23+
<directory>../../../lib/internal/*/*/Test</directory>
24+
<directory>../../../lib/internal/*/*/*/Test</directory>
25+
<directory>../../../setup/src/*/*/Test</directory>
26+
<directory>../../../vendor/*/*/Test</directory>
27+
</exclude>
28+
</whitelist>
29+
</filter>
30+
<php>
31+
<includePath>.</includePath>
32+
<includePath>testsuite</includePath>
33+
<ini name="date.timezone" value="America/Los_Angeles"/>
34+
<ini name="xdebug.max_nesting_level" value="200"/>
35+
<ini name="memory_limit" value="-1"/>
36+
<const name="TESTS_INSTALL_CONFIG_FILE" value="etc/install-config-mysql.php"/>
37+
<const name="TESTS_POST_INSTALL_SETUP_COMMAND_CONFIG_FILE" value="etc/post-install-setup-command-config.php"/>
38+
<const name="TESTS_GLOBAL_CONFIG_FILE" value="etc/config-global.php"/>
39+
<const name="TESTS_GLOBAL_CONFIG_DIR" value="../../../app/etc"/>
40+
<const name="TESTS_CLEANUP" value="enabled"/>
41+
<const name="TESTS_MEM_USAGE_LIMIT" value="8G"/>
42+
<const name="TESTS_MEM_LEAK_LIMIT" value="0"/>
43+
<const name="TESTS_EXTRA_VERBOSE_LOG" value="1"/>
44+
<const name="TESTS_MAGENTO_MODE" value="developer"/>
45+
<const name="TESTS_ERROR_LOG_LISTENER_LEVEL" value="-1"/>
46+
</php>
47+
<listeners>
48+
<listener class="Magento\TestFramework\Event\PhpUnit"/>
49+
<listener class="Magento\TestFramework\ErrorLog\Listener"/>
50+
</listeners>
51+
</phpunit>

.github/phpunit9-unit.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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.1/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="UnitTests">
12+
<directory suffix="Test.php">../../../vendor/%COMPOSER_NAME%/tests/unit</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+
</exclude>
22+
</whitelist>
23+
</filter>
24+
<php>
25+
<ini name="date.timezone" value="America/Los_Angeles"/>
26+
<ini name="xdebug.max_nesting_level" value="200"/>
27+
</php>
28+
</phpunit>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: ExtDN M2 Coding Standard
2+
on: []
3+
# push:
4+
# branches:
5+
# - master
6+
# pull_request:
7+
8+
jobs:
9+
static:
10+
name: M2 Coding Standard
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: extdn/github-actions-m2/magento-coding-standard/7.4@master
15+

.github/workflows/integration.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: ExtDN M2 Integration Tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
integration-tests:
10+
name: Magento 2 Integration Tests
11+
runs-on: ubuntu-latest
12+
services:
13+
mysql:
14+
image: mysql:5.7
15+
env:
16+
MYSQL_ROOT_PASSWORD: root
17+
ports:
18+
- 3306:3306
19+
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
20+
es:
21+
image: docker.io/wardenenv/elasticsearch:7.8
22+
ports:
23+
- 9200:9200
24+
env:
25+
'discovery.type': single-node
26+
'xpack.security.enabled': false
27+
ES_JAVA_OPTS: "-Xms64m -Xmx512m"
28+
options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: M2 Integration Tests with Magento 2 (Php7.4)
32+
uses: extdn/github-actions-m2/magento-integration-tests/7.4@master
33+
with:
34+
module_name: IntegerNet_ShippingPreselection
35+
composer_name: integer-net/magento2-shippingpreselection
36+
ce_version: '2.4.3'
37+
phpunit_file: .github/phpunit9-integration.xml

.github/workflows/mess-detector.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: ExtDN M2 Mess Detector
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
phpmd:
10+
name: M2 Mess Detector
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: extdn/github-actions-m2/magento-mess-detector@master
15+

.github/workflows/phpstan.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: ExtDN M2 PHPStan
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
phpstan:
10+
name: M2 PHPStan
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: extdn/github-actions-m2/magento-phpstan@master
15+
with:
16+
composer_name: integer-net/magento2-shippingpreselection
17+
# Note: module_source needs to be directory with composer.json, otherwise module is installed from github
18+
# and phpstan runs on local directory with broken autoloading. So the following does NOT work:
19+
#
20+
# module_source: src
21+
#
22+
# A possible workaround is to modify the root composer autoload section in a preinstall script:
23+
#
24+
magento_preinstall_script: .github/autoload-tests.sh
25+
env:
26+
INPUT_MAGENTO_PRE_INSTALL_SCRIPT: .github/autoload-tests.sh

.github/workflows/unit.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: ExtDN M2 Unit Tests
2+
on: [push]
3+
jobs:
4+
unit-tests:
5+
name: Magento 2 Unit Tests
6+
runs-on: ubuntu-latest
7+
env:
8+
REPOSITORY_URL: https://repo.magento.com/
9+
MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }}
10+
MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }}
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: docker://yireo/github-actions-magento-unit-tests:7.4
14+
with:
15+
# for unit tests, the path is not prefixed with GITHUB_WORKSPACE like for integration tests
16+
phpunit_file: vendor/integer-net/magento2-shippingpreselection/.github/phpunit9-unit.xml
17+
env:
18+
MAGENTO_VERSION: '2.4.3'
19+
MODULE_NAME: IntegerNet_ShippingPreselection
20+
COMPOSER_NAME: integer-net/magento2-shippingpreselection
21+

.scrutinizer.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

0 commit comments

Comments
 (0)