Skip to content

Commit c6355c1

Browse files
authored
Merge pull request #37 from bpolaszek/2.0.x-dev
Feat: 2.0
2 parents b6d6b9d + 55567d2 commit c6355c1

35 files changed

+975
-821
lines changed

.gitattributes

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text eol=lf
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/.github export-ignore
6+
/phpcs.xml.dist export-ignore
7+
/phpstan.neon.dist export-ignore
8+
/phpstan-baseline.neon export-ignore
9+
/phpunit.xml.dist export-ignore
10+
/psalm.xml.dist export-ignore
11+
/psalm-baseline.xml export-ignore
12+
/tests export-ignore
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Coding Standards"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
coding-standards:
11+
name: "Coding Standards"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
matrix:
16+
php-version:
17+
- "7.4"
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: "actions/checkout@v2"
22+
23+
- name: "Install PHP"
24+
uses: "shivammathur/setup-php@v2"
25+
with:
26+
coverage: "none"
27+
php-version: "${{ matrix.php-version }}"
28+
tools: "cs2pr"
29+
30+
- name: "Install dependencies with Composer"
31+
uses: "ramsey/composer-install@v1"
32+
33+
- name: "Run PHP_CodeSniffer"
34+
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: "0 0 1 * *"
8+
9+
jobs:
10+
unit-tests:
11+
name: "Unit Tests"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
matrix:
16+
php-version:
17+
- "7.4"
18+
- "8.0"
19+
dependencies:
20+
- "highest"
21+
include:
22+
- dependencies: "lowest"
23+
php-version: "7.4"
24+
25+
steps:
26+
- name: "Checkout"
27+
uses: "actions/checkout@v2"
28+
with:
29+
fetch-depth: 2
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
php-version: "${{ matrix.php-version }}"
35+
coverage: "pcov"
36+
ini-values: "zend.assertions=1"
37+
38+
- name: "Install dependencies with Composer"
39+
uses: "ramsey/composer-install@v1"
40+
with:
41+
dependency-versions: "${{ matrix.dependencies }}"
42+
43+
- name: "Run unit tests"
44+
run: "vendor/bin/pest --coverage-clover=coverage.xml"
45+
46+
- name: "Upload coverage file"
47+
uses: "actions/upload-artifact@v2"
48+
with:
49+
name: "pest-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
50+
path: "coverage.xml"
51+
52+
upload-coverage:
53+
name: "Upload coverage to Codecov"
54+
runs-on: "ubuntu-20.04"
55+
needs:
56+
- "unit-tests"
57+
58+
steps:
59+
- name: "Checkout"
60+
uses: "actions/checkout@v2"
61+
with:
62+
fetch-depth: 2
63+
64+
- name: "Download coverage files"
65+
uses: "actions/download-artifact@v2"
66+
with:
67+
path: "reports"
68+
69+
- name: "Upload to Codecov"
70+
uses: "codecov/codecov-action@v1"
71+
with:
72+
directory: reports

.github/workflows/static-analysis.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Static Analysis"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
static-analysis-phpstan:
11+
name: "Static Analysis with PHPStan"
12+
runs-on: "ubuntu-20.04"
13+
14+
strategy:
15+
matrix:
16+
php-version:
17+
- "7.4"
18+
19+
steps:
20+
- name: "Checkout code"
21+
uses: "actions/checkout@v2"
22+
23+
- name: "Install PHP"
24+
uses: "shivammathur/setup-php@v2"
25+
with:
26+
coverage: "none"
27+
php-version: "${{ matrix.php-version }}"
28+
tools: "cs2pr"
29+
30+
- name: "Install dependencies with Composer"
31+
uses: "ramsey/composer-install@v1"
32+
33+
- name: "Run a static analysis with phpstan/phpstan"
34+
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"
35+
36+
static-analysis-psalm:
37+
name: "Static Analysis with Psalm"
38+
runs-on: "ubuntu-20.04"
39+
40+
strategy:
41+
matrix:
42+
php-version:
43+
- "7.4"
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v2
48+
49+
- name: Psalm
50+
uses: docker://vimeo/psalm-github-actions:4.4.1
51+
with:
52+
composer_require_dev: true
53+
security_analysis: true
54+
report_file: results.sarif
55+
- name: Upload Security Analysis results to GitHub
56+
uses: github/codeql-action/upload-sarif@v1
57+
with:
58+
sarif_file: results.sarif

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
/vendor
2-
1+
/.phpcs-cache
2+
/.phpunit.result.cache
33
/composer.lock
4+
/phpcs.xml
5+
/phpstan.neon
6+
/psalm.xml
47
/phpunit.xml
8+
/vendor/

.scrutinizer.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)