Merge pull request #13 from lion-packages/Sleon4-patch-1 #43
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: Lion-Command (CI Workflow) | |
on: | |
push: | |
branches: | |
- main | |
- actions | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "15 0 * * *" | |
jobs: | |
composer-validation: | |
runs-on: ubuntu-latest | |
name: Composer Validation | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Cache Composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: vendor | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.4' | |
extensions: mbstring, gd, zip | |
- name: Composer Install | |
run: composer install | |
- name: Composer Validate | |
run: composer validate --strict | |
- name: Composer Check for vulnerabilities | |
run: composer audit --locked | |
- name: Composer Dump-Autoload | |
run: composer dump-autoload --optimize --strict-psr | |
code-analyze: | |
runs-on: ubuntu-latest | |
name: PHP Code Analyze | |
needs: | |
- composer-validation | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.4' | |
extensions: mbstring, gd, zip | |
- name: Composer Install | |
run: composer install --dev | |
- name: PHP CodeSnifer (Src) | |
run: php -d memory_limit=-1 vendor/bin/phpcs --standard=PSR12 src | |
- name: PHPStan (Src) | |
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max src | |
- name: PHP CodeSnifer (Tests) | |
run: php -d memory_limit=-1 vendor/bin/phpcs --standard=PSR12 tests | |
- name: PHPStan (Tests) | |
run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max tests | |
tests: | |
runs-on: ubuntu-latest | |
name: PHP Tests | |
needs: code-analyze | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.4 | |
extensions: mbstring, gd, zip, pdo, pdo_mysql, pdo_pgsql, redis, xdebug | |
coverage: xdebug | |
ini-values: | | |
xdebug.mode=coverage | |
xdebug.start_with_request=yes | |
xdebug.log_level=0 | |
tools: composer | |
- name: Install php dependencies | |
run: composer install | |
- name: Run tests | |
run: php vendor/bin/phpunit --coverage-clover tests/build/logs/clover.xml --coverage-html tests/build/coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: tests/build/logs/clover.xml | |
token: ${{ secrets.CODECOV_TOKEN_LION_COMMAND }} |