forked from absolute-quantum/DoctrineEncryptBundle
-
Notifications
You must be signed in to change notification settings - Fork 2
155 lines (128 loc) · 6.04 KB
/
ci.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# This file was heavily based on the ci-file from SymfonyCasts/verify-email-bundle
#
# See https://github.com/SymfonyCasts/verify-email-bundle
# https://github.com/SymfonyCasts/verify-email-bundle/blob/main/.github/workflows/ci.yml
name: CI
on:
push:
branches: ['main','master','5.4','6.0']
pull_request:
jobs:
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.0"
extensions: pdo, pdo_sqlite
- name: "Validate composer.json"
run: "composer validate --strict --no-check-lock"
- name: "Validate php-files"
run: "php -l src && php -l tests"
- name: "Composer install"
uses: "ramsey/composer-install@v3"
with:
composer-options: "--prefer-stable"
dependency-versions: 'highest'
- name: "PHPStan"
run: "vendor/bin/phpstan analyze"
- name: "PHPCompatibility"
run: "vendor/bin/phpcs src/ tests/ --standard=PHPCompatibility --runtime-set testVersion 7.2-8.1"
- name: PHP-CS-Fixer
uses: docker://ghcr.io/php-cs-fixer/php-cs-fixer:3.64-php8.3
with:
args: "check"
# use `check .` if your repository not having paths configured in .php-cs-fixer[.dist].php
tests:
name: "Tests ${{ matrix.php-version }} ${{ matrix.dependency-versions }}"
runs-on: ubuntu-latest
needs: static-analysis
strategy:
fail-fast: false
matrix:
# normal, highest, non-dev installs
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
composer-options: ['--prefer-stable']
dependency-versions: ['highest']
include:
# testing lowest PHP version with lowest dependencies
- php-version: '7.2.5'
dependency-versions: 'lowest'
composer-options: '--prefer-lowest'
env:
SYMFONY_PHPUNIT_VERSION: 7
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: pdo, pdo_sqlite
# - name: Install Global Dependencies
# run: |
# composer global require --no-progress --no-scripts --no-plugins symfony/flex >=1.x
- name: "Remove php-cs-fixer"
run: 'composer remove --dev friendsofphp/php-cs-fixer'
if: ${{ startsWith(matrix.php-version , '7') }}
- name: "Composer install"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
- name: Unit Tests
run: vendor/bin/simple-phpunit
env:
SYMFONY_PHPUNIT_VERSION: "${{ matrix.dependency-versions == 'lowest' && '7' || '' }}"
- name: Install symlinks for demo's
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo"
- name: Demo symfony5.4 - Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony5.4"
- name: Demo symfony5.4 - Unit Tests
run: demo/symfony5.4/bin/phpunit -c demo/symfony5.4/phpunit.xml.dist
env:
SYMFONY_PHPUNIT_VERSION: "${{ matrix.dependency-versions == 'lowest' && '7' || '' }}"
- name: Demo symfony6.x - Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony6.x"
if: ${{ startsWith(matrix.php-version , '8.1') || startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}
- name: Demo symfony6.x - Unit Tests
run: demo/symfony6.x/vendor/bin/simple-phpunit -c demo/symfony6.x/phpunit.xml.dist
if: ${{ startsWith(matrix.php-version , '8.1') || startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}
- name: Demo symfony6.x-orm3 - Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony6.x-orm3"
if: ${{ startsWith(matrix.php-version , '8.1') || startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}
- name: Demo symfony6.x-orm3 - Unit Tests
run: demo/symfony6.x/vendor/bin/simple-phpunit -c demo/symfony6.x-orm3/phpunit.xml.dist
if: ${{ startsWith(matrix.php-version , '8.1') || startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}
- name: Demo symfony7.x - Install dependencies
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony7.x"
if: ${{ startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}
- name: Demo symfony7.x - Unit Tests
run: demo/symfony7.x/vendor/bin/simple-phpunit -c demo/symfony7.x/phpunit.xml.dist
if: ${{ startsWith(matrix.php-version , '8.2') || startsWith(matrix.php-version , '8.3') || startsWith(matrix.php-version , '8.4') }}