Skip to content

Commit 6d7db22

Browse files
committed
Quality of life
1 parent a88cd5a commit 6d7db22

40 files changed

+3357
-856
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/tests export-ignore
2+
phpunit.xml.dist export-ignore
3+
behat.yml export-ignore
4+
phpcs.xml export-ignore
5+
psalm.xml export-ignore
6+
.gitignore export-ignore
7+
.gitattributes export-ignore
8+
composer.lock export-ignore
9+
.scrutinizer.yml export-ignore
10+
.travis.yml export-ignore
11+
.circleci.yml export-ignore
12+
.github export-ignore

.github/workflows/static.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Static Code Analysis
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
psalm:
7+
name: Psalm
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
13+
- name: Psalm
14+
uses: docker://vimeo/psalm-github-actions
15+
with:
16+
security_analysis: true
17+
report_file: results.sarif
18+
composer_ignore_platform_reqs: true
19+
20+
- name: Upload Security Analysis results to GitHub
21+
uses: github/codeql-action/upload-sarif@v1
22+
with:
23+
sarif_file: results.sarif
24+
25+
# we may use whatever way to install phpcs, just specify the path on the next step
26+
# however, curl seems to be the fastest
27+
- name: Install PHP_CodeSniffer
28+
run: |
29+
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
30+
php phpcs.phar --version
31+
32+
- uses: tinovyatkin/action-php-codesniffer@v1
33+
with:
34+
files: "**.php" # you may customize glob as needed
35+
phpcs_path: php phpcs.phar
36+
standard: phpcs.xml

.github/workflows/unit.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
- '*'
9+
10+
jobs:
11+
unittest:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php_version: ['7.4', '8.0', '8.1']
17+
prefer-lowest: ['', '--prefer-lowest']
18+
19+
name: Unit Tests - PHP ${{ matrix.php_version }} ${{ matrix.prefer-lowest }}
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php_version }}
28+
29+
- name: Validate composer.json and composer.lock
30+
run: composer validate --strict
31+
32+
- name: Cache Composer packages
33+
id: composer-cache
34+
uses: actions/cache@v2
35+
with:
36+
path: vendor
37+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
38+
restore-keys: |
39+
${{ runner.os }}-php-
40+
41+
- name: Install dependencies
42+
run: composer update --prefer-dist --no-progress --with-all-dependencies ${{ matrix.prefer-lowest }}
43+
44+
- name: Run test suite
45+
run: ./vendor/bin/phpunit --verbose --order-by=random

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ nbproject/private/
77
.project
88
.settings
99
composer.phar
10+
composer.lock
1011

1112
*.swl
1213
*~.nib
1314
*.orig
15+
.phpunit.result.cache
16+
.phpcs-cache
1417

18+
tests/log/*
19+
20+
vendor/

0 commit comments

Comments
 (0)