Skip to content

Commit 763a896

Browse files
committed
split workflows
1 parent a1015d2 commit 763a896

File tree

2 files changed

+110
-19
lines changed

2 files changed

+110
-19
lines changed

.github/workflows/codeception.yaml renamed to .github/workflows/elastic-search-codeception.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Codeception Tests"
1+
name: "Codeception Tests with Elastic Search"
22

33
on:
44
# Enable Later.
@@ -19,7 +19,6 @@ env:
1919
APP_ENV: test
2020
PIMCORE_TEST: 1
2121
PIMCORE_TEST_DB_DSN: "mysql://[email protected]:33006/pimcore_test"
22-
PIMCORE_OPEN_SEARCH_HOST: "localhost:39200"
2322
PIMCORE_ELASTIC_SEARCH_HOST: "localhost:5300"
2423
CODECEPTION_BUNDLE_PATH: "bundles/pimcore/generic-data-index-bundle/"
2524

@@ -31,9 +30,6 @@ jobs:
3130
strategy:
3231
matrix:
3332
include:
34-
- { php-version: "8.2", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" }
35-
- { php-version: "8.3", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"}
36-
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "openSearch"}
3733
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "elasticsearch"}
3834

3935
services:
@@ -44,19 +40,6 @@ jobs:
4440
env:
4541
MYSQL_ALLOW_EMPTY_PASSWORD: yes
4642

47-
opensearch:
48-
image: opensearchproject/opensearch:latest
49-
ports:
50-
- 39200:9200
51-
env:
52-
cluster.name: "opensearch-cluster"
53-
node.name: "opensearch-node"
54-
discovery.seed_hosts: "opensearch-node"
55-
bootstrap.memory_lock: true
56-
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
57-
discovery.type: "single-node"
58-
DISABLE_SECURITY_PLUGIN: true
59-
6043
elastic:
6144
image: elasticsearch:8.5.3
6245
ports:
@@ -68,7 +51,6 @@ jobs:
6851
xpack.security.authc.anonymous.roles: "superuser,kibana_admin,kibana_system,kibana_user"
6952
ELASTIC_USERNAME: "elastic"
7053
ELASTIC_PASSWORD: "somethingsecret"
71-
if: ${{ matrix.search_engine == 'elasticsearch' }}
7254

7355
steps:
7456
- name: "Checkout code"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: "Codeception Tests with Open Search"
2+
3+
on:
4+
# Enable Later.
5+
#schedule:
6+
# - cron: '0 3 * * 1,3,5'
7+
pull_request:
8+
branches:
9+
- "[0-9]+.[0-9]+"
10+
- "[0-9]+.x"
11+
- "feature-*"
12+
push:
13+
branches:
14+
- "[0-9]+.[0-9]+"
15+
- "[0-9]+.x"
16+
17+
env:
18+
PIMCORE_PROJECT_ROOT: ${{ github.workspace }}
19+
APP_ENV: test
20+
PIMCORE_TEST: 1
21+
PIMCORE_TEST_DB_DSN: "mysql://[email protected]:33006/pimcore_test"
22+
PIMCORE_OPEN_SEARCH_HOST: "localhost:39200"
23+
CODECEPTION_BUNDLE_PATH: "bundles/pimcore/generic-data-index-bundle/"
24+
25+
jobs:
26+
codeception-tests:
27+
name: "Codeception tests"
28+
runs-on: "ubuntu-20.04"
29+
continue-on-error: ${{ matrix.experimental }}
30+
strategy:
31+
matrix:
32+
include:
33+
- { php-version: "8.2", dependencies: "lowest", pimcore_version: "", experimental: false, search_engine: "openSearch" }
34+
- { php-version: "8.3", dependencies: "highest", pimcore_version: "", experimental: false, search_engine: "openSearch"}
35+
- { php-version: "8.3", dependencies: "highest", pimcore_version: "11.x-dev as 11.99.9", experimental: true, search_engine: "openSearch"}
36+
37+
services:
38+
mariadb:
39+
image: "mariadb:10.11"
40+
ports:
41+
- 33006:3306
42+
env:
43+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
44+
45+
opensearch:
46+
image: opensearchproject/opensearch:latest
47+
ports:
48+
- 39200:9200
49+
env:
50+
cluster.name: "opensearch-cluster"
51+
node.name: "opensearch-node"
52+
discovery.seed_hosts: "opensearch-node"
53+
bootstrap.memory_lock: true
54+
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
55+
discovery.type: "single-node"
56+
DISABLE_SECURITY_PLUGIN: true
57+
58+
steps:
59+
- name: "Checkout code"
60+
uses: "actions/checkout@v2"
61+
with:
62+
path: "bundles/pimcore/generic-data-index-bundle"
63+
64+
- name: "Copy .github directory"
65+
env:
66+
REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}"
67+
run: |
68+
cp -R bundles/pimcore/generic-data-index-bundle/.github .github
69+
70+
- name: "Install PHP"
71+
uses: "shivammathur/setup-php@v2"
72+
with:
73+
coverage: xdebug
74+
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
75+
php-version: "${{ matrix.php-version }}"
76+
77+
- name: Verify MariaDB connection
78+
run: |
79+
cp .github/ci/files/.my.cnf ~/.my.cnf
80+
while ! mysqladmin ping --silent; do
81+
sleep 1
82+
done
83+
84+
- name: "Setup Pimcore environment"
85+
env:
86+
REQUIRE_ADMIN_BUNDLE: "${{ matrix.require_admin_bundle }}"
87+
run: |
88+
mysql -e "CREATE DATABASE pimcore_test CHARSET=utf8mb4;"
89+
cp -R bundles/pimcore/generic-data-index-bundle/tests tests
90+
mkdir src
91+
chmod 755 .github/ci/scripts/setup-pimcore-environment-functional-tests.sh
92+
.github/ci/scripts/setup-pimcore-environment-functional-tests.sh "${{ matrix.search_engine }}"
93+
94+
- name: "Update Pimcore version"
95+
env:
96+
PIMCORE_VERSION: "${{ matrix.pimcore_version }}"
97+
run: |
98+
if [ ! -z "$PIMCORE_VERSION" ]; then
99+
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
100+
fi
101+
102+
- name: "Install dependencies with Composer"
103+
uses: "ramsey/composer-install@v2"
104+
with:
105+
dependency-versions: "${{ matrix.dependencies }}"
106+
107+
- name: "Run Codeception"
108+
run: |
109+
vendor/bin/codecept run -c . -vvv --xml --coverage-xml

0 commit comments

Comments
 (0)