Skip to content

Commit 09d0eeb

Browse files
Add github actions and PHP8.0 support (#4)
* Add GitHub actions and PHP8.0 support * Ignore platform requirements for GitHub actions Fixed #3
1 parent e945a1d commit 09d0eeb

File tree

3 files changed

+57
-23
lines changed

3 files changed

+57
-23
lines changed

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
php-version: [7.4, 8.0, 8.1]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
24+
- name: Cache Composer dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: /tmp/composer-cache
28+
key: ${{ runner.os }}-${{ matrix.php-version }}
29+
30+
- uses: php-actions/composer@v6
31+
with:
32+
php_version: ${{ matrix.php-version }}
33+
args: --prefer-dist --ignore-platform-reqs
34+
35+
- uses: php-actions/composer@v6
36+
with:
37+
php_version: ${{ matrix.php-version }}
38+
command: test

composer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"magento/module-catalog": "~103.0|~104.0",
88
"magento/module-quote": "~101.0",
99
"magento/module-customer": "~102.0|~103.0",
10-
"php": "~7.2"
10+
"php": "~7.2|~8.0"
1111
},
1212
"require-dev": {
1313
"phpstan/phpstan": "^0.12.86",
1414
"squizlabs/php_codesniffer": "^3.6.0",
15-
"phpunit/phpunit": "~8.5.15",
15+
"phpunit/phpunit": "~9.5",
1616
"ecomdev/magento2-test-essentials": "dev-main"
1717
},
1818
"license": [
@@ -21,7 +21,7 @@
2121
"repositories": {
2222
"magento": {
2323
"type": "composer",
24-
"url": "https://repo.magento.com/"
24+
"url": "https://mirror.mage-os.org"
2525
}
2626
},
2727
"autoload": {
@@ -42,5 +42,10 @@
4242
"phpcbf": "phpcbf",
4343
"phpstan": "phpstan analyze src",
4444
"test": "phpunit tests"
45+
},
46+
"config": {
47+
"allow-plugins": {
48+
"magento/composer-dependency-version-audit-plugin": false
49+
}
4550
}
4651
}

phpunit.xml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
4-
bootstrap="vendor/autoload.php"
5-
executionOrder="depends,defects"
6-
beStrictAboutOutputDuringTests="true"
7-
beStrictAboutTodoAnnotatedTests="true"
8-
colors="true">
9-
<testsuites>
10-
<testsuite name="default">
11-
<directory suffix="Test.php">tests</directory>
12-
</testsuite>
13-
</testsuites>
14-
15-
<filter>
16-
<whitelist processUncoveredFilesFromWhitelist="true">
17-
<directory suffix=".php">src</directory>
18-
</whitelist>
19-
</filter>
20-
21-
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" executionOrder="depends,defects" beStrictAboutOutputDuringTests="true" beStrictAboutTodoAnnotatedTests="true" colors="true">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">src</directory>
6+
</include>
7+
</coverage>
8+
<testsuites>
9+
<testsuite name="default">
10+
<directory suffix="Test.php">tests</directory>
11+
</testsuite>
12+
</testsuites>
2213
</phpunit>

0 commit comments

Comments
 (0)