Skip to content

Commit a0814eb

Browse files
committed
Add workflows for php
1 parent 19f17db commit a0814eb

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/php.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ v3.x ]
6+
pull_request:
7+
branches: [ v3.x ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
matrix:
14+
php-versions: ['7.0', '7.2', '7.3', '7.4']
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- name: Install PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
- name: Validate composer.json and composer.lock
23+
run: composer validate
24+
- name: Install dependencies
25+
run: composer install --prefer-dist --no-progress
26+
- name: Run PHPCS
27+
run: composer run-script lint
28+
- name: Run PHPUnit
29+
run: composer run-script test

composer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,9 @@
4545
},
4646
"autoload": {
4747
"psr-4": { "TraderInteractive\\": "src/" }
48+
},
49+
"scripts": {
50+
"lint": "vendor/bin/phpcs",
51+
"test": "vendor/bin/phpunit"
4852
}
4953
}

0 commit comments

Comments
 (0)