diff --git a/.github/workflows/composer-analysis.yml b/.github/workflows/composer-analysis.yml index d33a44f..598d62c 100644 --- a/.github/workflows/composer-analysis.yml +++ b/.github/workflows/composer-analysis.yml @@ -5,12 +5,25 @@ on: - cron: '0 3 * * 1,3,5' workflow_dispatch: push: + paths-ignore: + - 'doc/**' + - '**.md' + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" pull_request: + paths-ignore: + - 'doc/**' + - '**.md' types: [ opened, synchronize, reopened ] env: PIMCORE_PROJECT_ROOT: ${{ github.workspace }} +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test-composer: uses: pimcore/workflows-collection-public/.github/workflows/reusable-composer-test.yml@main diff --git a/.github/workflows/poeditor-export.yml b/.github/workflows/poeditor-export.yml deleted file mode 100644 index 7a4898f..0000000 --- a/.github/workflows/poeditor-export.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: "Trigger POEditor Translations Export" - -on: - workflow_dispatch: - push: - branches: - - "[0-9]+.x" - - "docs_actions" - - "main" - paths: - - "src/Resources/translations/admin.en.yml" - -permissions: - contents: read - -jobs: - poeditor: - uses: pimcore/workflows-collection-public/.github/workflows/reusable-poeditor.yaml@main - secrets: - POEDITOR_ACTION_TRIGGER_TOKEN: ${{ secrets.POEDITOR_ACTION_TRIGGER_TOKEN }} - diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9d4310b..85d400f 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,27 +2,44 @@ name: "Static analysis centralised" on: schedule: - - cron: '0 3 * * 1,3,5' + - cron: '0 3 * * 1,3,5' workflow_dispatch: + pull_request: + types: [ opened, synchronize, reopened ] + paths-ignore: + - 'assets/**' + - 'assets-customized/**' + - 'doc/**' + - 'install/**' + - 'src/Resources/public/**' + - '**.md' push: branches: - "[0-9]+.[0-9]+" - "[0-9]+.x" - - "feature-*" - pull_request: - types: [ opened, synchronize, reopened ] - + paths-ignore: + - 'assets/**' + - 'assets-customized/**' + - 'doc/**' + - 'install/**' + - 'src/Resources/public/**' + - '**.md' env: PIMCORE_PROJECT_ROOT: ${{ github.workspace }} PRIVATE_REPO: ${{ github.event.repository.private }} +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: setup-matrix: runs-on: ubuntu-latest + timeout-minutes: 30 outputs: php_versions: ${{ steps.parse-php-versions.outputs.php_versions }} - matrix: ${{ steps.set-matrix.outputs.matrix }} + phpstan_matrix: ${{ steps.set-matrix.outputs.phpstan_matrix }} private_repo: ${{ env.PRIVATE_REPO }} steps: - name: Checkout code @@ -41,55 +58,36 @@ jobs: 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 "No PHP versions found in composer.json" - echo "Setting default PHP value" - echo "php_versions=default" >> $GITHUB_OUTPUT + echo "php_versions=default" >> "$GITHUB_OUTPUT" else - echo "php_versions=$php_versions" >> $GITHUB_OUTPUT - echo "#### php versions #### : $php_versions" + echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT" fi else - echo "composer.json not found" exit 1 fi - - name: Set up matrix + - name: Set up matrix JSON id: set-matrix run: | php_versions="${{ steps.parse-php-versions.outputs.php_versions }}" - MATRIX_JSON=$(cat reusable-workflows/phpstan-configuration/matrix-config.json) - - IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions" - - 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 + FILTERED_MATRIX_JSON=$(echo "$MATRIX_JSON" | jq --arg php_versions "$php_versions" '{ include: [ .configs[] | select(.php_version == $php_versions) | .matrix[] ] }') + ENCODED_MATRIX_JSON=$(echo "$FILTERED_MATRIX_JSON" | jq -c .) + echo "phpstan_matrix=$ENCODED_MATRIX_JSON" >> "$GITHUB_OUTPUT" static-analysis: needs: setup-matrix - strategy: - matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} - uses: pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-centralized.yaml@main + uses: pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-unified.yaml@main with: + phpstan_matrix: ${{ needs.setup-matrix.outputs.phpstan_matrix }} + private_repo: ${{ needs.setup-matrix.outputs.private_repo }} APP_ENV: test PIMCORE_TEST: 1 - PRIVATE_REPO: ${{ needs.setup-matrix.outputs.private_repo}} - PHP_VERSION: ${{ matrix.matrix.php-version }} - SYMFONY: ${{ matrix.matrix.symfony }} - DEPENDENCIES: ${{ matrix.matrix.dependencies }} - EXPERIMENTAL: ${{ matrix.matrix.experimental }} - PIMCORE_VERSION: ${{ matrix.matrix.pimcore_version }} - COMPOSER_OPTIONS: ${{ matrix.matrix.composer_options }} + REQUIRE_ADMIN_BUNDLE: "false" + COVERAGE: "none" 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 }} \ No newline at end of file + COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN: ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }} + PIMCORE_CI_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }} + PIMCORE_CI_ENCRYPTION_SECRET: ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }} + PIMCORE_CI_PRODUCT_KEY: ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}