Skip to content

Commit 8b35c55

Browse files
authored
Add CI workflow
Configure GitHub Actions for automated testing
1 parent 45865a4 commit 8b35c55

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/symfony.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Symfony
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: ubuntu-latest
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php-version: ['8.1', '8.2', '8.3']
20+
symfony-version: ['6.4', '7.0']
21+
22+
name: PHP ${{ matrix.php-version }} - Symfony ${{ matrix.symfony-version }}
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Setup PHP
28+
uses: shivammathur/setup-php@v2
29+
with:
30+
php-version: ${{ matrix.php-version }}
31+
extensions: mbstring, xml, ctype, iconv, intl, pdo, pdo_mysql, pdo_pgsql
32+
coverage: none
33+
34+
- name: Cache Composer packages
35+
uses: actions/cache@v3
36+
with:
37+
path: vendor
38+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-symfony-${{ matrix.symfony-version }}-${{ hashFiles('**/composer.lock') }}
39+
restore-keys: |
40+
${{ runner.os }}-php-${{ matrix.php-version }}-symfony-${{ matrix.symfony-version }}-
41+
42+
- name: Install dependencies
43+
run: |
44+
composer require "symfony/framework-bundle:^${{ matrix.symfony-version }}" --no-update
45+
composer install --prefer-dist --no-progress --no-interaction
46+
47+
- name: Run PHPStan
48+
run: composer phpstan
49+
50+
- name: Run PHPUnit tests
51+
run: composer test

0 commit comments

Comments
 (0)