forked from integr8rs/DoctrineEncryptBundle
126 lines (103 loc) · 4.11 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
# 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']
pull_request:
jobs:
static-analysis:
name: Static Analysis
runs-on: ubuntu-22.04
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.0"
- 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@v2"
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"
tests:
name: "Tests ${{ matrix.php-version }} ${{ matrix.dependency-versions }}"
runs-on: ubuntu-22.04
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']
composer-options: ['--prefer-stable']
dependency-versions: ['highest']
# Disable lowest for now
# include:
# # testing lowest PHP version with lowest dependencies
# - php-version: '7.2.5'
# dependency-versions: 'lowest'
# composer-options: '--prefer-lowest'
steps:
- name: "Checkout code"
uses: "actions/checkout@v4"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
# - name: Install Global Dependencies
# run: |
# composer global require --no-progress --no-scripts --no-plugins symfony/flex >=1.x
- name: "Composer install"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
- name: Unit Tests
run: vendor/bin/simple-phpunit
- name: Install symlinks for demo's
uses: "ramsey/composer-install@v2"
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@v2"
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
- name: Demo symfony6.x - Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony6.x"
if: ${{ startsWith(matrix.php-version , '8.') }}
- 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.') }}
- name: Demo symfony7.x - Install dependencies
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependency-versions }}"
composer-options: "--prefer-dist --no-progress"
working-directory: "demo/symfony7.x"
if: ${{ startsWith(matrix.php-version , '8.2') }}
- 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') }}