Skip to content

Commit c7f2e1a

Browse files
committed
add github workflow
1 parent 973bc32 commit c7f2e1a

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/static.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Static Analysis
2+
on: [push, pull_request]
3+
jobs:
4+
phpstan:
5+
name: PHPStan
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: PHPStan
10+
uses: docker://oskarstark/phpstan-ga
11+
with:
12+
args: analyse src/

.github/workflows/tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tests
2+
3+
on: ['push', 'pull_request']
4+
5+
jobs:
6+
build:
7+
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, macos-latest, windows-latest]
12+
php: ['7.3', '7.4', '8.0']
13+
dependency-version: [prefer-lowest, prefer-stable]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
tools: composer:v2
23+
extensions: json, mbstring
24+
coverage: xdebug
25+
26+
- name: Setup Problem Matches
27+
run: |
28+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
29+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
30+
31+
- name: Install PHP 7 dependencies
32+
run: composer update --dev --${{ matrix.dependency-version }} --no-interaction --no-progress
33+
if: "matrix.php < 8"
34+
35+
- name: Install PHP 8 dependencies
36+
run: composer update --dev --${{ matrix.dependency-version }} --ignore-platform-req=php --no-interaction --no-progress
37+
if: "matrix.php >= 8"
38+
39+
- name: Run Tests with Coverage
40+
run: ./vendor/bin/pest --coverage

0 commit comments

Comments
 (0)