Skip to content

Use centralized Tests #572

Use centralized Tests

Use centralized Tests #572

name: "Codeception Tests with Elasticsearch"
on:
schedule:
- cron: "0 3 * * 1,3,5"
workflow_dispatch:
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 }}
PRIVATE_REPO: ${{ github.event.repository.private }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
php_versions: ${{ steps.parse-php-versions.outputs.php_versions }}
matrix: ${{ steps.set-matrix.outputs.matrix }}
private_repo: ${{ env.PRIVATE_REPO }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout reusable workflow repo
uses: actions/checkout@v4
with:
repository: pimcore/workflows-collection-public
ref: main
path: reusable-workflows
- name: Parse PHP versions from composer.json
id: parse-php-versions
run: |
if [ -f composer.json ]; then
php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//')
if [ -z "$php_versions" ]; then
echo "php_versions=default" >> "$GITHUB_OUTPUT"
else
echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT"
fi
else
exit 1
fi
- name: Set up matrix JSON
id: set-matrix
run: |
php_versions="${{ steps.parse-php-versions.outputs.php_versions }}"
MATRIX_JSON=$(cat reusable-workflows/codeception-tests-configuration/matrix-config.json)
FILTERED_MATRIX_JSON=$(echo "$MATRIX_JSON" | jq --arg php_versions "$php_versions" '{ matrix: [ .configs[] | select(.php_version == $php_versions) | .matrix[] ] }')
ENCODED_MATRIX_JSON=$(echo "$FILTERED_MATRIX_JSON" | jq -c .)
echo "matrix=$ENCODED_MATRIX_JSON" >> "$GITHUB_OUTPUT"
codeception-tests:
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
uses: pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main

Check warning on line 69 in .github/workflows/elastic-search-codeception.yaml

View workflow run for this annotation

GitHub Actions / Codeception Tests with Elasticsearch

Workflow syntax warning

In .github/workflows/elastic-search-codeception.yaml (Line: 69, Col: 15): Error from called workflow pimcore/workflows-collection-public/.github/workflows/reusable-codeception-tests-centralized.yaml@main (Line: 217, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
with:
APP_ENV: test
PIMCORE_TEST: "1"
PRIVATE_REPO: "false"
PHP_VERSION: ${{ matrix.matrix.php-version }}
DATABASE: "mariadb:10.11"
DEPENDENCIES: ${{ matrix.matrix.dependencies }}
EXPERIMENTAL: ${{ matrix.matrix.experimental }}
PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }}
REQUIRE_ADMIN_BUNDLE: "false"
PIMCORE_ELASTIC_SEARCH_HOST: "39201"
PIMCORE_ELASTIC_SEARCH_VERSION: "8.5.3"
ENABLE_ELASTICSEARCH: true
COVERAGE: "xdebug"
secrets:
SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER: ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }}
COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }}
PIMCORE_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }}
PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}