ADD path filter #364
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: | |
| push: | |
| branches: [ 5.5 ] | |
| pull_request: | |
| branches: [ 5.5 ] | |
| permissions: | |
| contents: read | |
| env: | |
| XDEBUG_MODE: coverage | |
| jobs: | |
| backend: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| php-versions: [ '8.3' ] # do not test 8.0 because of phpstan errors with doctrine/collections | |
| composer-prefer: [ '', '--prefer-lowest' ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| # extensions: intl #optional | |
| ini-values: "post_max_size=256M" #optional | |
| - name: Check PHP Version | |
| run: php -v | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate --strict | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer-prefer }} | |
| - name: Run phpstan | |
| run: ./vendor/bin/phpstan analyse | |
| - name: Run tests | |
| run: ./vendor/bin/phpunit --coverage-text --coverage-html=.phpunit.cache/html-report | |
| - name: Code Style check | |
| run: ./vendor/bin/php-cs-fixer fix -v --diff --dry-run | |
| - name: phpunit-coverage-badge | |
| uses: timkrase/phpunit-coverage-badge@v1.2.1 | |
| with: | |
| push_badge: true | |
| coverage_badge_path: .github/badges/coverage.svg | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| frontend: | |
| needs: backend | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| node-versions: [ '18' ] | |
| npm-versions: [ '10' ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: ${{ matrix.node-versions }} | |
| - name: Restore composer cache | |
| id: composer-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Check Node.js Version | |
| run: node -v | |
| - name: Check npm Version | |
| run: npm -v | |
| - name: Cache npm packages | |
| id: npm-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: assets/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('assets/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install npm dependencies | |
| run: npm install | |
| working-directory: assets | |
| - name: Run eslint | |
| run: npx eslint scripts/* | |
| working-directory: assets | |