diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..be1db82 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/composer.json b/composer.json index e0f9d77..7164308 100644 --- a/composer.json +++ b/composer.json @@ -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": [ @@ -21,7 +21,7 @@ "repositories": { "magento": { "type": "composer", - "url": "https://repo.magento.com/" + "url": "https://mirror.mage-os.org" } }, "autoload": { @@ -42,5 +42,10 @@ "phpcbf": "phpcbf", "phpstan": "phpstan analyze src", "test": "phpunit tests" + }, + "config": { + "allow-plugins": { + "magento/composer-dependency-version-audit-plugin": false + } } } diff --git a/phpunit.xml b/phpunit.xml index 67a68d4..dcb9e90 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,22 +1,13 @@ - - - - tests - - - - - - src - - - - + + + + src + + + + + tests + +