Skip to content

Commit b76743b

Browse files
committed
ci: initial upload
1 parent 4d7d7a1 commit b76743b

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/ci.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop" ]
6+
pull_request:
7+
branches: [ "main", "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
14+
code-style:
15+
runs-on: 'ubuntu-latest'
16+
name: 'Coding style'
17+
steps:
18+
- name: 'Checkout'
19+
uses: 'actions/checkout@v3'
20+
21+
- name: 'Setup PHP'
22+
uses: 'shivammathur/setup-php@v2'
23+
with:
24+
php-version: '8.1'
25+
coverage: 'none'
26+
tools: 'composer:v2, composer-normalize'
27+
28+
- name: 'Install dependencies'
29+
run: |
30+
composer install --no-interaction --no-progress --ansi
31+
32+
- name: 'Check PHP code'
33+
run: |
34+
composer phpcs
35+
composer phpmd
36+
37+
- name: 'Check composer.json'
38+
run: 'composer-normalize --diff --dry-run --no-update-lock'
39+
if: 'always()'
40+
41+
phpunit:
42+
runs-on: ${{ matrix.system }}
43+
name: 'PHPUnit (PHP ${{ matrix.php }} - ${{ matrix.system }})'
44+
strategy:
45+
matrix:
46+
system: ['ubuntu-latest']
47+
php:
48+
- '8.1'
49+
steps:
50+
- name: Checkout Code
51+
uses: actions/checkout@v3
52+
53+
- name: 'Setup PHP'
54+
uses: 'shivammathur/setup-php@v2'
55+
with:
56+
php-version: '${{ matrix.php }}'
57+
coverage: 'none'
58+
tools: 'composer:v2'
59+
60+
- name: 'Install dependencies'
61+
run: |
62+
composer install --no-interaction --no-progress --ansi
63+
64+
- name: 'Run unit tests'
65+
run: |
66+
composer phpunit
67+
68+
code-coverage:
69+
runs-on: 'ubuntu-latest'
70+
name: 'Code Coverage'
71+
steps:
72+
- name: 'Checkout'
73+
uses: 'actions/checkout@v3'
74+
75+
- name: 'Setup PHP'
76+
uses: 'shivammathur/setup-php@v2'
77+
with:
78+
php-version: '8.1'
79+
tools: 'composer:v2'
80+
81+
- name: 'Install dependencies'
82+
run: |
83+
composer install --no-interaction --no-progress --ansi
84+
85+
- name: 'Run code coverage'
86+
run: |
87+
composer coverage
88+
89+
- name: Send code coverage report to Codecov.io
90+
uses: codecov/codecov-action@v2
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)