-
Notifications
You must be signed in to change notification settings - Fork 6
133 lines (119 loc) · 5.17 KB
/
codeception.yaml
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
name: "Codeception Tests"
on:
# Enable Later.
#schedule:
# - cron: '0 3 * * 1,3,5'
pull_request:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
- "feature-*"
push:
branches:
- "[0-9]+.[0-9]+"
- "[0-9]+.x"
env:
PIMCORE_PROJECT_ROOT: ${{ github.workspace }}
APP_ENV: test
PIMCORE_TEST: 1
PIMCORE_TEST_DB_DSN: "mysql://root@127.0.0.1:33006/pimcore_test"
PIMCORE_OPEN_SEARCH_HOST: "localhost:39200"
CODECEPTION_BUNDLE_PATH: "bundles/pimcore/generic-data-index-bundle/"
jobs:
codeception-tests:
name: "Codeception tests"
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- { php-version: "8.2", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" }
- { php-version: "8.3", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"}
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "openSearch"}
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "elasticsearch"}
services:
mariadb:
image: "mariadb:10.11"
ports:
- 33006:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
opensearch:
image: opensearchproject/opensearch:latest
ports:
- 39200:9200
env:
cluster.name: "opensearch-cluster"
node.name: "opensearch-node"
discovery.seed_hosts: "opensearch-node"
bootstrap.memory_lock: true
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
discovery.type: "single-node"
DISABLE_SECURITY_PLUGIN: true
elastic:
image: elasticsearch:8.5.3
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1g -Xmx1g
- xpack.security.enabled=true
- xpack.security.authc.anonymous.roles=superuser,kibana_admin,kibana_system,kibana_user
- ELASTIC_USERNAME=elastic
- ELASTIC_PASSWORD=somethingsecret
ports:
- 5300:9200
deploy:
resources:
limits:
cpus: '1'
memory: '2G'
healthcheck:
test: [ "CMD", "curl", "-f", "http://elastic:9200/_cluster/health?wait_for_status=yellow&timeout=50s" ]
interval: 30s
retries: 5
start_period: 10s
timeout: 10s
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
with:
path: "bundles/pimcore/generic-data-index-bundle"
- name: "Copy .github directory"
env:
REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}"
run: |
cp -R bundles/pimcore/generic-data-index-bundle/.github .github
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: xdebug
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
php-version: "${{ matrix.php-version }}"
- name: Verify MariaDB connection
run: |
cp .github/ci/files/.my.cnf ~/.my.cnf
while ! mysqladmin ping --silent; do
sleep 1
done
- name: "Setup Pimcore environment"
env:
REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}"
run: |
mysql -e "CREATE DATABASE pimcore_test CHARSET=utf8mb4;"
cp -R bundles/pimcore/generic-data-index-bundle/tests tests
mkdir src
chmod 755 .github/ci/scripts/setup-pimcore-environment-functional-tests.sh
.github/ci/scripts/setup-pimcore-environment-functional-tests.sh "${{ matrix.search_engine }}"
- name: "Update Pimcore version"
env:
PIMCORE_VERSION: "${{ matrix.pimcore_version }}"
run: |
if [ ! -z "$PIMCORE_VERSION" ]; then
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
fi
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"
- name: "Run Codeception"
run: |
vendor/bin/codecept run -c . -vvv --xml --coverage-xml