Skip to content

Commit 45d2a1d

Browse files
committed
ci(ci.yml): add workflow
1 parent cfb5a1e commit 45d2a1d

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
tests:
14+
runs-on: ${{ matrix.os }}
15+
16+
env:
17+
ENV: DEVELOPMENT
18+
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
os: [ubuntu-latest]
23+
php: ['8.3']
24+
dependency_version: [prefer-dist, prefer-source]
25+
26+
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency_version }}
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup PHP & Enable Extensions
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: ${{ runner.php }}
36+
extensions: uopz
37+
coverage: pcov
38+
39+
- name: Validate composer.json and composer.lock
40+
run: composer validate --working-dir=. --strict
41+
42+
- name: Cache Composer packages
43+
id: composer-cache
44+
uses: actions/cache@v4
45+
with:
46+
path: ./src/vendor
47+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
48+
restore-keys: |
49+
${{ runner.os }}-php-
50+
51+
- name: Install PHP dependencies
52+
run: composer install --working-dir=. --${{ matrix.dependency_version }} --no-interaction --no-progress --ansi
53+
54+
- name: Check PHP Syntax
55+
run: composer check-syntax
56+
57+
- name: Check Coding Standards
58+
run: composer check-style
59+
60+
- name: Check with PHPStan
61+
run: composer phpstan
62+
63+
- name: Check Test Cases
64+
run: composer tests

0 commit comments

Comments
 (0)