CI Joomla Framework #59
This file contains hidden or 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: CI Joomla Framework | |
| on: | |
| push: | |
| pull_request: | |
| schedule: | |
| - cron: 15 2 * * 1 | |
| 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.1 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| id: cache-php | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
| - 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 install --no-progress --ignore-platform-reqs | |
| code-style-php: | |
| name: Check PHP code style | |
| runs-on: ubuntu-latest | |
| container: joomlaprojects/docker-images:php8.1 | |
| needs: [composer] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
| - name: Check PHP code style | |
| env: | |
| PHP_CS_FIXER_IGNORE_ENV: true | |
| run: ./vendor/bin/phpcs --standard=ruleset.xml src/ | |
| phpstan: | |
| name: Run PHPstan | |
| runs-on: ubuntu-latest | |
| container: joomlaprojects/docker-images:php8.4 | |
| needs: [code-style-php] | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/cache/restore@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} | |
| - name: Run PHPstan | |
| run: | | |
| ./vendor/bin/phpstan --error-format=github | |
| tests-unit-lowest: | |
| name: Run Unit tests | |
| runs-on: ubuntu-latest | |
| container: joomlaprojects/docker-images:php8.1 | |
| needs: [code-style-php] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Unit tests | |
| run: | | |
| git config --global --add safe.directory $GITHUB_WORKSPACE | |
| composer update --prefer-stable --prefer-lowest | |
| ./vendor/bin/phpunit | |
| 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'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run Unit tests | |
| run: | | |
| git config --global --add safe.directory $GITHUB_WORKSPACE | |
| composer update | |
| ./vendor/bin/phpunit | |
| 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'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php_version }} | |
| extensions: openssl, mbstring, fileinfo, ftp | |
| - name: Install Composer dependencies | |
| run: | | |
| git config --global --add safe.directory $GITHUB_WORKSPACE | |
| composer install --no-progress --ignore-platform-reqs | |
| - name: Run Unit tests | |
| run: php vendor/bin/phpunit |