Skip to content

Commit

Permalink
Add github actions and PHP8.0 support (#4)
Browse files Browse the repository at this point in the history
* Add GitHub actions and PHP8.0 support

* Ignore platform requirements for GitHub actions

Fixed #3
  • Loading branch information
IvanChepurnyi authored Nov 21, 2022
1 parent e945a1d commit 09d0eeb
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 23 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PHP Composer

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
php-version: [7.4, 8.0, 8.1]

steps:
- uses: actions/checkout@v3

- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ matrix.php-version }}

- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
args: --prefer-dist --ignore-platform-reqs

- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-version }}
command: test
11 changes: 8 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"magento/module-catalog": "~103.0|~104.0",
"magento/module-quote": "~101.0",
"magento/module-customer": "~102.0|~103.0",
"php": "~7.2"
"php": "~7.2|~8.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.86",
"squizlabs/php_codesniffer": "^3.6.0",
"phpunit/phpunit": "~8.5.15",
"phpunit/phpunit": "~9.5",
"ecomdev/magento2-test-essentials": "dev-main"
},
"license": [
Expand All @@ -21,7 +21,7 @@
"repositories": {
"magento": {
"type": "composer",
"url": "https://repo.magento.com/"
"url": "https://mirror.mage-os.org"
}
},
"autoload": {
Expand All @@ -42,5 +42,10 @@
"phpcbf": "phpcbf",
"phpstan": "phpstan analyze src",
"test": "phpunit tests"
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": false
}
}
}
31 changes: 11 additions & 20 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
executionOrder="depends,defects"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
colors="true">
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>


<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">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="default">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit 09d0eeb

Please sign in to comment.