Feedback #464
Workflow file for this run
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: PHP Composer | |
| on: | |
| push: | |
| branches: [ "main", "next" ] | |
| pull_request: | |
| branches: [ "main", "next" ] | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:5.7 | |
| env: | |
| MYSQL_ROOT_PASSWORD: password | |
| MYSQL_DATABASE: test | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Prepare hosting deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get -y install ghostscript | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22.x | |
| cache: 'npm' | |
| - name: Prepare JS/CSS dependencies | |
| env: | |
| FONTAWESOME_AUTH_TOKEN: ${{ secrets.FONTAWESOME_AUTH_TOKEN }} | |
| run: | | |
| npm config set "@fortawesome:registry" https://npm.fontawesome.com/ | |
| npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_AUTH_TOKEN | |
| npm install | |
| - name: Build npm | |
| run: npm run build | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: xdebug, imagick | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-scripts | |
| - name: Lint | |
| run: | | |
| php bin/console lint:yaml config --parse-tags | |
| php bin/console lint:twig templates | |
| ./vendor/bin/phpcs | |
| ./vendor/bin/phpstan | |
| - name: Test | |
| run: | | |
| mv .env.github .env.local | |
| php bin/console doctrine:database:create --no-interaction --if-not-exists | |
| php bin/console doctrine:migrations:migrate --no-interaction | |
| php bin/phpunit |