Skip to content

Commit 4ab7b28

Browse files
Create symfony.yml
1 parent 6b262b7 commit 4ab7b28

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/symfony.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Symfony
7+
8+
on:
9+
push:
10+
branches: [ "main" ]
11+
pull_request:
12+
branches: [ "main" ]
13+
types:
14+
- opened
15+
- reopened
16+
- synchronize
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
symfony-tests:
23+
runs-on: ubuntu-latest
24+
steps:
25+
# To automatically get bug fixes and new Php versions for shivammathur/setup-php,
26+
# change this to (see https://github.com/shivammathur/setup-php#bookmark-versioning):
27+
# uses: shivammathur/setup-php@v2
28+
- uses: shivammathur/setup-php@2cb9b829437ee246e9b3cac53555a39208ca6d28
29+
with:
30+
php-version: '8.4'
31+
- uses: actions/checkout@v4
32+
- name: Copy .env.test.local
33+
run: php -r "file_exists('.env.test.local') || copy('.env.example', '.env.test.local');"
34+
- name: Cache Composer packages
35+
id: composer-cache
36+
uses: actions/cache@v3
37+
with:
38+
path: vendor
39+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-php-
42+
- name: Install Dependencies
43+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
44+
- name: Create Database
45+
run: |
46+
mkdir -p data
47+
touch data/database.sqlite
48+
- name: Run PHPStan (Static Analysis)
49+
run: vendor/bin/phpstan analyse --memory-limit=2G
50+
- name: Run php-cs-fixer
51+
run: vendor/bin/php-cs-fixer check
52+
- name: Run Security Checker
53+
run: vendor/bin/security-checker security:check
54+
- name: Run PHPUnit Tests
55+
env:
56+
DATABASE_URL: sqlite:///%kernel.project_dir%/data/database.sqlite
57+
run: php bin/phpunit --testdox

0 commit comments

Comments
 (0)