Skip to content

Commit 1828c4d

Browse files
committed
add build
1 parent 536e1cd commit 1828c4d

File tree

3 files changed

+59
-1
lines changed

3 files changed

+59
-1
lines changed

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: samsonasik

.github/workflows/ci_build.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "ci build"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
9+
jobs:
10+
build:
11+
name: PHP ${{ matrix.php-versions }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-versions: ['7.4', '8.0', '8.1']
17+
steps:
18+
- name: Setup PHP Action
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
extensions: intl
22+
php-version: "${{ matrix.php-versions }}"
23+
coverage: xdebug
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- name: "Validate composer.json and composer.lock"
27+
run: "composer validate"
28+
- name: "Install dependencies"
29+
run: "composer install"
30+
- name: "CS Check"
31+
run: "composer cs-check"
32+
- name: "Code analyze"
33+
run: |
34+
composer phpstan
35+
composer rector
36+
- name: "Run test suite"
37+
run: "composer test"
38+
# - if: matrix.php-versions == '8.1'
39+
# name: Run mutation test
40+
# env:
41+
# INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
42+
# STRYKER_DASHBOARD_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
43+
# run: |
44+
# composer require --dev infection/infection
45+
# vendor/bin/infection
46+
# - if: matrix.php-versions == '8.1'
47+
# name: Upload coverage to Codecov
48+
# uses: codecov/codecov-action@v1
49+
# with:
50+
# token: ${{ secrets.CODECOV_TOKEN }}
51+
# file: ./build/logs/clover.xml
52+
# flags: tests
53+
# name: codecov-umbrella
54+
# yml: ./codecov.yml
55+
# fail_ci_if_error: true

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
"scripts": {
5050
"cs-check": "phpcs",
5151
"cs-fix": "phpcbf",
52-
"phpstan": "phpstan analyse src/ --level=max -c phpstan.neon"
52+
"phpstan": "phpstan analyse src/ --level=max -c phpstan.neon",
53+
"rector": "rector process --dry-run",
54+
"test": "phpunit"
5355
}
5456
}

0 commit comments

Comments
 (0)