@@ -2,27 +2,38 @@ name: "Static analysis centralised"
22
33on :
44 schedule :
5- - cron : ' 0 3 * * 1,3,5'
5+ - cron : ' 0 3 * * 1,3,5'
66 workflow_dispatch :
7+ pull_request :
8+ types : [ opened, synchronize, reopened ]
9+ paths-ignore :
10+ - ' doc/**'
11+ - ' public/**'
12+ - ' **.md'
713 push :
14+ paths-ignore :
15+ - ' doc/**'
16+ - ' public/**'
17+ - ' **.md'
818 branches :
919 - " [0-9]+.[0-9]+"
1020 - " [0-9]+.x"
11- - " feature-*"
12- pull_request :
13- types : [ opened, synchronize, reopened ]
14-
1521
1622env :
1723 PIMCORE_PROJECT_ROOT : ${{ github.workspace }}
1824 PRIVATE_REPO : ${{ github.event.repository.private }}
1925
26+ concurrency :
27+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
28+ cancel-in-progress : true
29+
2030jobs :
2131 setup-matrix :
2232 runs-on : ubuntu-latest
33+ timeout-minutes : 10
2334 outputs :
2435 php_versions : ${{ steps.parse-php-versions.outputs.php_versions }}
25- matrix : ${{ steps.set-matrix.outputs.matrix }}
36+ phpstan_matrix : ${{ steps.set-matrix.outputs.phpstan_matrix }}
2637 private_repo : ${{ env.PRIVATE_REPO }}
2738 steps :
2839 - name : Checkout code
@@ -41,55 +52,36 @@ jobs:
4152 if [ -f composer.json ]; then
4253 php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//')
4354 if [ -z "$php_versions" ]; then
44- echo "No PHP versions found in composer.json"
45- echo "Setting default PHP value"
46- echo "php_versions=default" >> $GITHUB_OUTPUT
55+ echo "php_versions=default" >> "$GITHUB_OUTPUT"
4756 else
48- echo "php_versions=$php_versions" >> $GITHUB_OUTPUT
49- echo "#### php versions #### : $php_versions"
57+ echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT"
5058 fi
5159 else
52- echo "composer.json not found"
5360 exit 1
5461 fi
5562
56- - name : Set up matrix
63+ - name : Set up matrix JSON
5764 id : set-matrix
5865 run : |
5966 php_versions="${{ steps.parse-php-versions.outputs.php_versions }}"
60-
6167 MATRIX_JSON=$(cat reusable-workflows/phpstan-configuration/matrix-config.json)
62-
63- IFS=',' read -ra VERSIONS_ARRAY <<< "$php_versions"
64-
65- FILTERED_MATRIX_JSON=$(echo $MATRIX_JSON | jq --arg php_versions "$php_versions" '
66- {
67- matrix: [
68- .configs[] |
69- select(.php_version == $php_versions) |
70- .matrix[]
71- ]
72- }')
73-
74- ENCODED_MATRIX_JSON=$(echo $FILTERED_MATRIX_JSON | jq -c .)
75-
76- echo "matrix=${ENCODED_MATRIX_JSON}" >> $GITHUB_OUTPUT
68+ FILTERED_MATRIX_JSON=$(echo "$MATRIX_JSON" | jq --arg php_versions "$php_versions" '{ include: [ .configs[] | select(.php_version == $php_versions) | .matrix[] ] }')
69+ ENCODED_MATRIX_JSON=$(echo "$FILTERED_MATRIX_JSON" | jq -c .)
70+ echo "phpstan_matrix=$ENCODED_MATRIX_JSON" >> "$GITHUB_OUTPUT"
7771
7872 static-analysis :
7973 needs : setup-matrix
80- strategy :
81- matrix : ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
82- uses : pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-centralized.yaml@main
74+ uses : pimcore/workflows-collection-public/.github/workflows/reusable-static-analysis-unified.yaml@main
8375 with :
76+ phpstan_matrix : ${{ needs.setup-matrix.outputs.phpstan_matrix }}
77+ private_repo : ${{ needs.setup-matrix.outputs.private_repo }}
8478 APP_ENV : test
8579 PIMCORE_TEST : 1
86- PRIVATE_REPO : ${{ needs.setup-matrix.outputs.private_repo}}
87- PHP_VERSION : ${{ matrix.matrix.php-version }}
88- SYMFONY : ${{ matrix.matrix.symfony }}
89- DEPENDENCIES : ${{ matrix.matrix.dependencies }}
90- EXPERIMENTAL : ${{ matrix.matrix.experimental }}
91- PIMCORE_VERSION : ${{ matrix.matrix.pimcore_version }}
92- COMPOSER_OPTIONS : ${{ matrix.matrix.composer_options }}
80+ REQUIRE_ADMIN_BUNDLE : " false"
81+ COVERAGE : " none"
9382 secrets :
9483 SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER : ${{ secrets.SSH_PRIVATE_KEY_PIMCORE_DEPLOYMENTS_USER }}
95- COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN : ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
84+ COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN : ${{ secrets.COMPOSER_PIMCORE_REPO_PACKAGIST_TOKEN }}
85+ PIMCORE_CI_INSTANCE_IDENTIFIER : ${{ secrets.PIMCORE_CI_INSTANCE_IDENTIFIER }}
86+ PIMCORE_CI_ENCRYPTION_SECRET : ${{ secrets.PIMCORE_CI_ENCRYPTION_SECRET }}
87+ PIMCORE_CI_PRODUCT_KEY : ${{ secrets.PIMCORE_CI_PRODUCT_KEY }}
0 commit comments