Skip to content

Commit 18a43a1

Browse files
Merge pull request #11 from run-as-root/feature/#9-github-actions
Feature/#9 GitHub actions
2 parents 8613b60 + 71703a8 commit 18a43a1

File tree

26 files changed

+303
-90
lines changed

26 files changed

+303
-90
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'Cache Composer packages'
2+
runs:
3+
using: 'composite'
4+
steps:
5+
- id: composer-cache
6+
uses: actions/cache@v3
7+
with:
8+
path: vendor
9+
key: ${{ inputs.runner-os }}-php-${{ hashFiles('**/composer.lock') }}
10+
restore-keys: |
11+
${{ inputs.runner-os }}-php-
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Test Extension
2+
3+
on:
4+
push:
5+
branches: [ "master", "develop" ]
6+
pull_request:
7+
branches: [ "master", "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
validate-composer:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Validate composer.json and composer.lock
21+
run: composer validate
22+
23+
build:
24+
25+
runs-on: ubuntu-latest
26+
27+
needs: validate-composer
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: ./.github/actions/composer-cache
32+
33+
- name: Install dependencies
34+
run: composer install --prefer-dist --no-progress
35+
36+
PHP-Compatibility:
37+
runs-on: ubuntu-latest
38+
39+
needs: build
40+
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: ./.github/actions/composer-cache
44+
45+
- name: PHP 8.1 compatibility
46+
run: composer sniffer:php8.1
47+
48+
Static-tests:
49+
runs-on: ubuntu-latest
50+
51+
needs: build
52+
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: ./.github/actions/composer-cache
56+
57+
- name: phpstan
58+
run: composer phpstan
59+
60+
- name: sniffer
61+
run: composer sniffer
62+
63+
- name: mess-detector
64+
run: composer mess-detector
65+
66+
PHP-Unit:
67+
runs-on: ubuntu-latest
68+
69+
needs: build
70+
71+
steps:
72+
- uses: actions/checkout@v3
73+
- uses: ./.github/actions/composer-cache
74+
75+
- name: Setup PHP with Xdebug
76+
uses: shivammathur/setup-php@v2
77+
with:
78+
php-version: '8.1'
79+
coverage: xdebug
80+
81+
- name: PHP Unit
82+
run: composer test
83+
84+
- name: phpunit-coverage-badge
85+
uses: timkrase/[email protected]
86+
with:
87+
report: reports/test-reports/clover.xml
88+
coverage_badge_path: output/coverage.svg
89+
push_badge: true
90+
commit_message: "Update coverage badge"
91+
repo_token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
![Magento 2](https://img.shields.io/badge/Magento-2.5.*-orange)
2+
![PHP](https://img.shields.io/badge/php-8.1-blue)
3+
![packagist](https://img.shields.io/badge/packagist-f28d1a)
4+
![build](https://github.com/run-as-root/magento2-message-queue-retry/actions/workflows/test_extension.yml/badge.svg)
5+
16
# run-as-root/magento2-message-queue-retry
27

38
It gives the possibility to process the same queue message more than once,

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@
2222
"require-dev": {
2323
"phpunit/phpunit": "~9.5.20",
2424
"phpmd/phpmd": "^2.13",
25-
"phpstan/phpstan": "^1.6.8",
25+
"phpstan/phpstan": "^1.10",
2626
"squizlabs/php_codesniffer": "~3.7.0",
2727
"magento/magento-coding-standard": "*",
2828
"phpcompatibility/php-compatibility": "^9.3",
2929
"slevomat/coding-standard": "^8.8",
3030
"sebastian/phpcpd": "^6.0",
31-
"pdepend/pdepend": "^2.13"
31+
"pdepend/pdepend": "^2.13",
32+
"bitexpert/phpstan-magento": "^0.29.0"
3233
},
3334
"repositories": [
3435
{
@@ -62,6 +63,6 @@
6263
"sniffer": "vendor/bin/phpcs --colors -p ./src --standard=phpcs-ruleset.xml",
6364
"fix-style": "vendor/bin/phpcbf --colors -p ./src --standard=phpcs-ruleset.xml",
6465
"sniffer:php8.1": "vendor/bin/phpcs -p ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1",
65-
"mess-detector": "vendor/bin/phpmd src html phpmd-ruleset.xml --exclude \"Test\" --strict --reportfile reports/phpmd/phpmd.html"
66+
"mess-detector": "vendor/bin/phpmd src html phpmd-ruleset.xml --exclude \"Test,src/Queue/Consumer.php\" --strict --reportfile reports/phpmd/phpmd.html"
6667
}
6768
}

0 commit comments

Comments
 (0)