CI #792
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 | |
| on: | |
| # Run CI every night at 2am | |
| schedule: | |
| - cron: 0 2 * * * | |
| # Run CI on every Pull Request | |
| pull_request: ~ | |
| # Run CI only on push on develop branch | |
| push: | |
| workflow_dispatch: | |
| env: | |
| PHP_VERSION: 8.4 | |
| NODE_VERSION: 22 | |
| permissions: | |
| contents: read | |
| jobs: | |
| phpcpd: | |
| name: PHPCPD | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run phpcpd tests | |
| run: vendor/bin/phpcpd src --exclude=src/Entity --exclude=src/Repository | |
| tests: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xdebug, xml, xmlwriter, xsl, zip | |
| coverage: xdebug | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run phpunit tests | |
| run: bin/phpunit --coverage-text --coverage-xml=build/logs/phpunit/coverage-xml --coverage-clover=build/logs/phpunit/clover.xml --log-junit=build/logs/phpunit/junit.xml --colors=never --order-by=random --exclude-group=integration | |
| - name: Run Infection tests | |
| run: vendor/bin/infection --skip-initial-tests --coverage=build/logs/phpunit --min-covered-msi=80 --threads=30 | |
| - name: Install MariaDB | |
| uses: getong/mariadb-action@v1.11 | |
| with: | |
| mysql database: 'bewelcome_test' | |
| mysql user: 'bewelcome' | |
| mysql password: 'bewelcome' | |
| - name: Create test database | |
| run: bin/console test:database:create --env=test | |
| - name: Warmup cache | |
| run: bin/console cache:clear --env=test | |
| - name: Setup Yarn | |
| uses: threeal/setup-yarn-action@v2.0.0 | |
| with: | |
| version: latest | |
| cache: false | |
| - name: Install yarn dependencies and run webpack | |
| run: yarn install --frozen-lock ; yarn encore dev | |
| - name: Run Integration tests | |
| run: bin/phpunit --log-junit=build/logs/phpunit/integration.xml --colors=never --order-by=random --group=integration | |
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag=v4.6.2 | |
| if: ${{ always() }} | |
| with: | |
| name: infection.log | |
| path: infection.log | |
| phploc: | |
| name: PHPLoc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run phploc | |
| run: vendor/bin/phploc --log-xml=phploc.xml src tests | |
| phpstan: | |
| name: PHPStan (experimental) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction --no-scripts | |
| - name: Run phpstan | |
| continue-on-error: true | |
| run: vendor/bin/phpstan | |
| # phpmd: | |
| # name: PHPMD | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| # | |
| # - name: Setup PHP | |
| # uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| # with: | |
| # php-version: ${{ env.PHP_VERSION }} | |
| # extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| # | |
| # - name: Get Composer Cache Directory | |
| # id: composer-cache | |
| # run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| # | |
| # - name: Cache dependencies | |
| # uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| # with: | |
| # path: ${{ steps.composer-cache.outputs.dir }} | |
| # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| # restore-keys: ${{ runner.os }}-composer- | |
| # | |
| # - name: Install project dependencies | |
| # run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| # | |
| # - name: Run phpmd tests | |
| # run: vendor/bin/phpmd src,tests text phpmd.xml | |
| php-cs-fixer: | |
| name: PHP-CS-Fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run php-cs-fixer tests | |
| run: vendor/bin/php-cs-fixer fix -v --diff --dry-run | |
| php-code-sniffer: | |
| name: PHP-Code-Sniffer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run php-code-sniffer tests | |
| run: vendor/bin/phpcs --colors --warning-severity=Error | |
| lint-yaml: | |
| name: Lint YAML | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Run Linter | |
| run: bin/console lint:yaml --parse-tags config fixtures | |
| doctrine-schema-validator: | |
| name: Validate Doctrine schema | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| - name: Validate Doctrine schema | |
| run: bin/console doctrine:schema:validate --skip-sync | |
| security: | |
| name: Security checks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.2.2 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # tag=2.35.2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: curl, dom, gd, iconv, intl, json, libxml, mbstring, mysqli, pcntl, pdo_mysql, phar, tokenizer, xml, xmlwriter, xsl, zip | |
| tools: symfony | |
| - name: Setup NODE | |
| uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # tag=v3.9.1 | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache dependencies | |
| uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # tag=v4.2.4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install project dependencies | |
| run: | | |
| composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts | |
| yarn install --frozen-lock | |
| - name: Run PHP security checker | |
| run: symfony security:check | |
| - name: Run JS security checker | |
| run: yarn audit --groups dependencies | |