PHP Composer #3057
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Composer | |
on: | |
push: | |
pull_request: | |
types: [ assigned, opened, synchronize, reopened ] | |
schedule: | |
- cron: '30 1 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
php-versions: ['7.1', '7.4', '8.1'] | |
fail-fast: false | |
name: PHP ${{ matrix.php-versions }} Test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP ${{ matrix.php-versions }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Install Composer and Dependencies | |
run: sudo apt-get update && curl -s http://getcomposer.org/installer | php && php composer.phar self-update && php composer.phar install | |
- name: Fix for issue 502 | |
run: sudo apt-get --fix-broken install | |
- name: Install additional Software | |
run: sudo apt-get install libxml2-utils | |
- name: Solr | |
run: sudo bash bin/install_solr_docker.sh | |
- name: Start MySQL | |
run: sudo systemctl start mysql.service | |
- name: Prepare database | |
run: export MYSQL_PWD=root && mysql --default-character-set=utf8 -h 'localhost' -P '3306' -u 'root' -v -e "CREATE DATABASE IF NOT EXISTS opusdb DEFAULT CHARACTER SET = UTF8 DEFAULT COLLATE = UTF8_GENERAL_CI; CREATE USER 'opus4admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT ALL PRIVILEGES ON opusdb.* TO 'opus4admin'@'localhost'; CREATE USER 'opus4'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; GRANT SELECT,INSERT,UPDATE,DELETE ON opusdb.* TO 'opus4'@'localhost'; FLUSH PRIVILEGES;" | |
- name: Lint PHP files | |
run: ant lint | |
- name: Setup folders | |
run: ant prepare-workspace prepare-test-workspace | |
- name: Setup config | |
run: ant prepare-config lint -DdbUserPassword=root -DdbAdminPassword=root -DphpVersion=${{ matrix.php-versions }} | |
- name: Setup testdata | |
run: ant reset-testdata | |
- name: Mail-Server | |
run: php scripts/opus-smtp-dumpserver.php 2>&1 >> tests/workspace/log/opus-smtp-dumpserver.log & | |
- name: Test-library | |
run: php composer.phar test -- --testsuite library | |
- name: Test-modules | |
run: php composer.phar test -- --testsuite modules | |
- name: Test-admin | |
run: php composer.phar test -- --testsuite admin | |
- name: Test-security | |
run: php composer.phar test -- --testsuite security | |
- name: Test-scripts | |
run: php composer.phar test -- --testsuite scripts | |
- name: Coding-Style | |
run: php composer.phar cs-check |