-
-
Notifications
You must be signed in to change notification settings - Fork 14
132 lines (112 loc) · 4.22 KB
/
tests.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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
env:
FLOW_CONTEXT: Testing
NEOS_TARGET_VERSION: '9.0'
NEOS_BASE_FOLDER: neos-base-distribution
PACKAGE_FOLDER: redirect-neosadapter
COMPOSER_ALLOW_SUPERUSER: 1
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.2', '8.3']
services:
mariadb:
# see https://mariadb.com/kb/en/mariadb-server-release-dates/
# this should be a current release, e.g. the LTS version
image: mariadb:10.8
env:
MYSQL_USER: neos
MYSQL_PASSWORD: neos
MYSQL_DATABASE: neos_functional_testing
MYSQL_ROOT_PASSWORD: neos
ports:
- "3306:3306"
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
with:
path: ${{ env.PACKAGE_FOLDER }}
- name: Set package branch name
run: echo "PACKAGE_TARGET_VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
working-directory: .
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
coverage: xdebug #optional
ini-values: opcache.fast_shutdown=0
- name: Update Composer
run: |
sudo composer self-update
composer --version
# Directory permissions for .composer are wrong, so we remove the complete directory
# https://github.com/actions/virtual-environments/issues/824
- name: Delete .composer directory
run: |
sudo rm -rf ~/.composer
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Checkout development distribution
uses: actions/checkout@v2
with:
repository: neos/neos-development-distribution
ref: ${{ env.NEOS_TARGET_VERSION }}
path: ${{ env.NEOS_BASE_FOLDER }}
- name: Prepare external packages for development distribution
run: |
cd ${NEOS_BASE_FOLDER}
composer require --no-update --no-interaction neos/redirecthandler:"^6.0"
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:"^6.0"
git -C ../${{ env.PACKAGE_FOLDER }} checkout -b build
composer config repositories.package '{ "type": "path", "url": "../${{ env.PACKAGE_FOLDER }}", "options": { "symlink": false } }'
composer require --no-update --no-interaction neos/redirecthandler-neosadapter:"dev-build as dev-${PACKAGE_TARGET_VERSION}"
composer require --dev --no-update --no-interaction phpstan/phpstan:^1.11
- name: Composer Install
run: |
cd ${NEOS_BASE_FOLDER}
composer update --no-interaction --no-progress
- name: Linting
run: |
cd ${NEOS_BASE_FOLDER}/Packages/Application/Neos.RedirectHandler.NeosAdapter
composer run lint:phpstan
- name: Setup Flow configuration
run: |
cd ${NEOS_BASE_FOLDER}
mkdir -p Configuration/Testing
rm -f Configuration/Testing/Settings.yaml
cat <<EOF >> Configuration/Testing/Settings.yaml
Neos:
Flow:
persistence:
backendOptions:
host: '127.0.0.1'
driver: pdo_mysql
user: 'neos'
password: 'neos'
dbname: 'neos_functional_testing'
EOF
- name: Run Behavioral tests
run: |
cd ${NEOS_BASE_FOLDER}
# we have to doctrine migrate and setup the cr here as otherwise a transaction error will occur:
# see also https://github.com/neos/neos-development-collection/pull/5005
FLOW_CONTEXT=Testing ./flow doctrine:migrate --quiet; FLOW_CONTEXT=Testing ./flow cr:setup
cd Packages/Application/Neos.RedirectHandler.NeosAdapter
composer run test:behavioral:stop-on-failure
- name: Show log on failure
if: ${{ failure() }}
run: |
cd ${NEOS_BASE_FOLDER}
cat Data/Logs/System_Testing.log