/
githubmirror
/
joomla-cms
Обзор
Документация
Войти
/
githubmirror
/
joomla-cms
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
5.4-dev
.github/workflows/ci.yml
426 строк
17 KB
David Schmithüsen
[5.4] Fix failing build on forks (#48108)
18 июл 2026, 14:42
Не верифицирован
18 июл 2026, 14:42
43a5a0f
Код
Авторство
О чём код?
name: CI Joomla on: push: pull_request: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: composer: name: Install PHP dependencies runs-on: ubuntu-latest container: joomlaprojects/docker-images:php8.5 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: cache-php with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} - name: Install PHP dependencies if: steps.cache-php.outputs.cache-hit != 'true' run: | git config --global --add safe.directory $GITHUB_WORKSPACE composer config --global home composer validate --no-check-all --strict composer install --no-progress --ignore-platform-reqs npm: name: Install JS/CSS dependencies and build assets runs-on: ubuntu-latest container: joomlaprojects/docker-images:php8.5 needs: [composer] steps: - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: latest - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: cache-assets with: path: | node_modules media installation/template/css key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'build/media_source/**', 'administrator/components/com_media/resources/**', 'installation/template/scss/**') }} - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} - name: Build assets if: steps.cache-assets.outputs.cache-hit != 'true' run: npm ci code-style-php: name: Check PHP code style runs-on: ubuntu-latest container: joomlaprojects/docker-images:php8.5 needs: [composer] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} - name: Check PHP code style env: PHP_CS_FIXER_IGNORE_ENV: true run: | set -e ./libraries/vendor/bin/php-cs-fixer fix -vvv --diff git config --global --add safe.directory "$GITHUB_WORKSPACE" if [ "$GITHUB_EVENT_NAME" = "push" ] && [ "$GITHUB_REPOSITORY" != "joomla/joomla-cms" ] && ! git diff --quiet; then git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add --all git commit -m "Fix code style issues [skip ci]" git push origin "HEAD:${{ github.head_ref || github.ref_name }}" fi code-style-js-css: name: Check Javascript & CSS code style runs-on: ubuntu-latest container: joomlaprojects/docker-images:php8.5 needs: [composer, npm] strategy: matrix: check: ['lint:js', 'lint:testjs', 'lint:css'] steps: - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: latest - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | node_modules media installation/template/css key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'build/media_source/**', 'administrator/components/com_media/resources/**', 'installation/template/scss/**') }} - name: Check code style run: npm run ${{ matrix.check }} phpstan: name: Run PHPstan runs-on: ubuntu-latest container: joomlaprojects/docker-images:php8.5 needs: [code-style-php] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} - name: Run PHPstan run: | set -e ./libraries/vendor/bin/phpstan --error-format=github ./libraries/vendor/bin/phpstan --generate-baseline git config --global --add safe.directory "$GITHUB_WORKSPACE" if [ "$GITHUB_EVENT_NAME" = "push" ] && [ "$GITHUB_REPOSITORY" != "joomla/joomla-cms" ] && ! git diff --quiet -- phpstan-baseline.neon; then git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add phpstan-baseline.neon git commit -m "Updated PHPStan baseline [skip ci]" git push origin "HEAD:${{ github.head_ref || github.ref_name }}" fi tests-unit: name: Run Unit tests runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] strategy: matrix: php_version: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - name: Run Unit tests run: ./libraries/vendor/bin/phpunit --testsuite Unit tests-integration: name: Run integration tests runs-on: ubuntu-latest container: joomlaprojects/docker-images:php${{ matrix.php_version }} needs: [code-style-php] strategy: matrix: php_version: ['8.1', '8.2', '8.3', '8.4', '8.5'] config: - my_version: '9' engine: 'mysqli' host: 'mysql' user: 'joomla_ut' - my_version: '8.4' engine: 'mysqli' host: 'mysql' user: 'joomla_ut' - my_version: '8.0.13' engine: 'mysqli' host: 'mysql' user: 'joomla_ut' - maria_version: '12.0' engine: 'mysqli' host: 'maria' user: 'joomla_ut' - maria_version: '10.4' engine: 'mysqli' host: 'maria' user: 'joomla_ut' - pg_version: '12.0' engine: 'pgsql' host: 'postgres' user: 'root' - pg_version: '18.0' engine: 'pgsql' host: 'postgres' user: 'root' steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Start LDAP container uses: docker://docker with: args: docker run -d --name openldap --network ${{ job.container.network }} --network-alias openldap -e "LDAP_ADMIN_USERNAME=admin" -e "LDAP_ADMIN_PASSWORD=adminpassword" -e "LDAP_USERS=customuser" -e "LDAP_PASSWORDS=custompassword" -e "LDAP_ENABLE_TLS=yes" -e "LDAP_TLS_CERT_FILE=/certs/openldap.crt" -e "LDAP_TLS_KEY_FILE=/certs/openldap.key" -e "LDAP_TLS_CA_FILE=/certs/CA.crt" -e "BITNAMI_DEBUG=true" -e "LDAP_CONFIG_ADMIN_ENABLED=yes" -e "LDAP_CONFIG_ADMIN_USERNAME=admin" -e "LDAP_CONFIG_ADMIN_PASSWORD=configpassword" -v "${{ github.workspace }}/tests/certs/openldap.crt":"/certs/openldap.crt" -v "${{ github.workspace }}/tests/certs/openldap.key":"/certs/openldap.key" -v "${{ github.workspace }}/tests/certs/CA.crt":"/certs/CA.crt" ghcr.io/joomla-projects/mirror-bitnami-openldap:latest - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - name: Run Integration tests env: JTEST_DB_ENGINE: ${{ matrix.config.engine }} JTEST_DB_HOST: ${{ matrix.config.host }} JTEST_DB_USER: ${{ matrix.config.user }} JTEST_DB_NAME: test_joomla JTEST_DB_PASSWORD: joomla_ut run: | sleep 3 ./libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit.xml.dist - name: Stop LDAP container uses: docker://docker with: args: docker kill openldap services: mysql: image: mysql:${{ matrix.config.my_version || '9' }} env: MYSQL_USER: joomla_ut MYSQL_PASSWORD: joomla_ut MYSQL_ROOT_PASSWORD: joomla_ut MYSQL_DATABASE: test_joomla maria: image: mariadb:${{ matrix.config.maria_version || '12.0' }} env: MARIADB_USER: joomla_ut MARIADB_PASSWORD: joomla_ut MARIADB_ROOT_PASSWORD: joomla_ut MARIADB_DATABASE: test_joomla postgres: image: postgres:${{ matrix.config.pg_version || '18' }}-alpine env: POSTGRES_USER: root POSTGRES_PASSWORD: joomla_ut POSTGRES_DB: test_joomla tests-unit-windows: name: Run Unit tests (Windows) runs-on: windows-latest needs: [code-style-php] strategy: matrix: php_version: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: cache-php-windows with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - name: Setup PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1 with: php-version: ${{ matrix.php_version }} extensions: openssl, mbstring, fileinfo, gd, gmp, pgsql, mysql, mysqli, curl, opcache, ldap ini-values: post_max_size=256M, date.timezone="UTC" - name: Install Composer dependencies if: steps.cache-php-windows.outputs.cache-hit != 'true' run: composer install --no-progress --ignore-platform-reqs - name: Run Unit tests run: php libraries/vendor/bin/phpunit --testsuite Unit tests-integration-windows: name: Run integration tests (Windows) runs-on: windows-latest needs: [code-style-php] strategy: matrix: php_version: ['8.1', '8.2', '8.3', '8.4', '8.5'] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - uses: shogo82148/actions-setup-mysql@c80f44ab210a360ef966c5b9f48a2ae21123b533 # v1.51.0 with: mysql-version: "mariadb-10.4" root-password: "joomla_ut" user: "joomla_ut" password: "joomla_ut" - name: Setup PHP uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2.37.1 with: php-version: ${{ matrix.php_version }} extensions: openssl, mbstring, fileinfo, gd, gmp, pgsql, mysql, mysqli, curl, opcache, ldap ini-values: post_max_size=256M, date.timezone="UTC" - name: Install Composer dependencies if: steps.cache-php-windows.outputs.cache-hit != 'true' run: | composer install --no-progress --ignore-platform-reqs mysql -uroot -pjoomla_ut -e 'CREATE DATABASE IF NOT EXISTS test_joomla;' - name: Run Integration tests run: | sleep 3 php libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-windows.xml.dist tests-system-prepare: name: Prepare system tests runs-on: ubuntu-latest container: joomlaprojects/docker-images:cypress8.5 needs: [composer, npm] env: CYPRESS_VERIFY_TIMEOUT: 100000 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | node_modules media installation/template/css key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'build/media_source/**', 'administrator/components/com_media/resources/**', 'installation/template/scss/**') }} - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 id: cache-cypress with: path: | /root/.cache/Cypress /github/home/.cache/Cypress key: ${{ runner.os }}-cypress-${{ hashFiles('package-lock.json') }} - name: Install Cypress dependencies if: steps.cache-cypress.outputs.cache-hit != 'true' run: | npx cypress install npx cypress verify tests-system: name: Run system tests runs-on: ubuntu-latest container: joomlaprojects/docker-images:cypress${{ matrix.config.php_version }} needs: [tests-system-prepare] strategy: matrix: browser: ['chrome', 'edge'] config: - php_version: '8.5' test_group: cmysqlmax db_engine: mysqli db_host: mysql my_version: '9' - php_version: '8.5' test_group: cmysqllts db_engine: mysqli db_host: mysql my_version: '8.4' - php_version: '8.1' test_group: cmysql db_engine: mysqli db_host: mysql my_version: '8.0.13' - php_version: '8.4' test_group: cmariamax db_engine: mysqli db_host: maria maria_version: '12.0' - php_version: '8.1' test_group: cmaria db_engine: mysqli db_host: maria maria_version: '10.4' - php_version: '8.1' test_group: cpostgres db_engine: pgsql db_host: postgres pg_version: '12.0' - php_version: '8.5' test_group: cpostgresmax db_engine: pgsql db_host: postgres pg_version: '18.0' env: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: libraries/vendor key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | node_modules media installation/template/css key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'build/media_source/**', 'administrator/components/com_media/resources/**', 'installation/template/scss/**') }} - uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 with: path: | /root/.cache/Cypress /github/home/.cache/Cypress key: ${{ runner.os }}-cypress-${{ hashFiles('package-lock.json') }} - name: Run System tests run: bash tests/System/entrypoint.sh "$(pwd)" ${{ matrix.config.test_group }} ${{ matrix.config.db_engine }} ${{ matrix.config.db_host }} ${{ matrix.browser }} - name: Archive test results results uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() with: name: system-test-output path: tests/System/output if-no-files-found: ignore services: mysql: image: mysql:${{ matrix.config.my_version || '9' }} env: MYSQL_USER: joomla_ut MYSQL_PASSWORD: joomla_ut MYSQL_ROOT_PASSWORD: joomla_ut MYSQL_DATABASE: test_joomla maria: image: mariadb:${{ matrix.config.maria_version || '12.0' }} env: MARIADB_USER: joomla_ut MARIADB_PASSWORD: joomla_ut MARIADB_ROOT_PASSWORD: joomla_ut MARIADB_DATABASE: test_joomla postgres: image: postgres:${{ matrix.config.pg_version || '18' }}-alpine env: POSTGRES_USER: root POSTGRES_PASSWORD: joomla_ut POSTGRES_DB: test_joomla typos: name: Check for typos runs-on: ubuntu-latest steps: - name: Checkout Actions Repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Spell Check Repository uses: crate-ci/typos@7b04f660f4ee4f048d18fd341887cf28dfbedfe2 # v1.46.3 with: config: .github/workflows/typos.toml