Skip to content

Commit a7c100a

Browse files
Add github workflows
1 parent af80224 commit a7c100a

File tree

4 files changed

+1440
-147
lines changed

4 files changed

+1440
-147
lines changed

.github/workflows/static.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Static Analysis
2+
3+
on: ['push', 'pull_request']
4+
5+
jobs:
6+
cs:
7+
runs-on: ubuntu-latest
8+
9+
name: Code Style
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
path:
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: 7.4
21+
tools: composer:v2
22+
coverage: none
23+
24+
- name: Install Dependencies
25+
run: composer update --no-interaction --no-progress
26+
27+
- name: Run PHP-CS-Fixer
28+
run: composer test:lint
29+
30+
phpstan:
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
dependency-version: [prefer-lowest, prefer-stable]
35+
36+
name: PHPStan ${{ matrix.dependency-version }}
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v2
41+
42+
- name: Setup PHP
43+
uses: shivammathur/setup-php@v2
44+
with:
45+
php-version: 7.4
46+
tools: composer:v2
47+
coverage: none
48+
49+
- name: Install Dependencies
50+
run: composer update --prefer-stable --no-interaction --no-progress
51+
52+
- name: Run PHPStan
53+
run: composer test:types

.github/workflows/tests.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
php: [7.4]
16+
dependency-version: [prefer-lowest, prefer-stable]
17+
18+
name: PHP ${{ matrix.php }} ${{ matrix.dependency-version }}
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
tools: composer:v2
29+
coverage: none
30+
31+
- name: Setup Problem Matchers
32+
run: |
33+
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
34+
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
35+
36+
37+
- name: Install PHP dependencies
38+
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress
39+
40+
- name: Run Tests
41+
run: composer test:features

composer.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"php": "^7.4"
1919
},
2020
"require-dev": {
21+
"friendsofphp/php-cs-fixer": "^2.18",
2122
"pestphp/pest": "^1.0",
2223
"phpstan/phpstan": "^0.12.70"
2324
},
@@ -27,9 +28,9 @@
2728
}
2829
},
2930
"scripts": {
30-
"lint": "php-cs-fixer fix -v",
31-
"test:lint": "php-cs-fixer fix -v --dry-run",
32-
"test:types": "phpstan analyse src --ansi --memory-limit=0 --level=5",
31+
"lint": "./vendor/bin/php-cs-fixer fix -v",
32+
"test:lint": "./vendor/bin/php-cs-fixer fix -v --dry-run",
33+
"test:types": "./vendor/bin/phpstan analyse src --ansi --memory-limit=0 --level=5",
3334
"test:features": "./vendor/bin/pest --colors=always",
3435
"test:coverage": "./vendor/bin/pest --coverage --min=90",
3536
"test": [
@@ -42,4 +43,4 @@
4243
"sort-packages": true
4344
},
4445
"prefer-stable": true
45-
}
46+
}

0 commit comments

Comments
 (0)