Skip to content

🧑‍💻 Keep it simple #23

🧑‍💻 Keep it simple

🧑‍💻 Keep it simple #23

Workflow file for this run

name: CI
on:
pull_request: ~
push:
branches: [ "main" ]
env:
PHP_VERSION: "8.4"
PHP_EXTENSIONS: "mbstring, intl, pdo_mysql, opcache, zip, bcmath"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Artifact (with permissions)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: ${{ env.PHP_EXTENSIONS }}
tools: composer:v2,symfony-cli
- name: "Validate composer.json"
run: composer validate --strict
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: --prefer-dist --no-progress --no-interaction
- name: Cleanup build
run: |
rm -Rf .git/
security:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Artifact (with permissions)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: ${{ env.PHP_EXTENSIONS }}
tools: composer:v2,symfony-cli
- name: "Security Check"
run: symfony security:check
coding-standards:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Artifact (with permissions)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: ${{ env.PHP_EXTENSIONS }}
tools: symfony-cli
ini-values: memory_limit=-1
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
with:
composer-options: --prefer-dist --no-progress --optimize-autoloader --no-interaction
- name: Install phpstan
uses: ramsey/composer-install@v3
with:
composer-options: --no-progress --no-scripts --prefer-dist
working-directory: tools/phpstan
- name: Run phpstan
run: tools/phpstan/vendor/bin/phpstan analyse
- name: Install php-cs-fixer
uses: ramsey/composer-install@v3
with:
composer-options: --no-progress --no-scripts --prefer-dist
working-directory: tools/php-cs-fixer
- name: Run php-cs-fixer
run: tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff
tests:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Artifact (with permissions)
uses: actions/cache@v4
with:
path: ${{ github.workspace }}
key: artifacts-${{ github.run_id }}-${{ github.run_number }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: ${{ env.PHP_EXTENSIONS }}
tools: symfony-cli
coverage: xdebug
ini-values: memory_limit=-1
- name: Run PHPUnit
run: |
vendor/bin/phpunit \
--testdox \
--log-junit junit.xml \
--coverage-text \
--coverage-clover coverage.xml
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
file: junit.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}