-
Notifications
You must be signed in to change notification settings - Fork 13
68 lines (54 loc) · 1.77 KB
/
build.yml
File metadata and controls
68 lines (54 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: build
on:
push:
branches: [ "main" ]
pull_request:
types:
- opened
- reopened
- synchronize
permissions:
contents: read
jobs:
symfony-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: pdo_mysql, gd, zip, opcache, bcmath
- uses: actions/checkout@v4
- name: Copy .env.test.local
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');"
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Lint Container
run: php bin/console lint:container
- name: Lint Twig Templates
run: php bin/console lint:twig templates
- name: Lint YAML Config Files
run: php bin/console lint:yaml config
- name: Run PHPStan
run: vendor/bin/phpstan analyse --level=3 src
- name: Run PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff --dry-run
- name: Create Database
run: |
mkdir -p var
touch var/test.db
- name: Execute tests (Unit and Feature tests) via PHPUnit
env:
DATABASE_URL: sqlite:///%kernel.project_dir%/var/test.db
run: vendor/bin/phpunit