feature-products #114
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: Pull Request | CI Pest Coverage | |
| on: pull_request | |
| jobs: | |
| ci_pest: | |
| runs-on: ubuntu-latest | |
| name: pull-request | ci pest coverage | |
| env: | |
| PHP_VERSION: 8.5 | |
| NODE_VERSION: 24 | |
| PEST_MIN_COVERAGE: 1 | |
| PEST_MIN_TYPE_COVERAGE: 1 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP Environment | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ env.PHP_VERSION }} | |
| extensions: dom, curl, fileinfo, pgsql, pdo_pgsql, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, xdebug | |
| coverage: xdebug | |
| - name: Prepare the .env file | |
| run: cp .env.ci .env | |
| - name: Cache Composer Dependencies | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| ~/.composer/cache/files | |
| ~/.composer/cache/repo | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install Composer Dependencies | |
| run: composer install --no-progress --prefer-dist --no-interaction --optimize-autoloader | |
| - name: Publish Laravel assets | |
| run: php artisan vendor:publish --tag=laravel-assets --ansi --force | |
| - name: Setup Database | |
| run: | | |
| sudo systemctl start postgresql.service | |
| sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" | |
| sudo -u postgres createdb testing | |
| - name: Generate App Key & Run Migrations | |
| run: | | |
| php artisan key:generate | |
| php artisan migrate:fresh | |
| - name: Setup Node.js Environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - name: Install NPM Dependencies | |
| run: npm install --frozen-lockfile | |
| - name: Build Frontend Assets | |
| run: npm run build | |
| - name: List PHP -v | |
| run: php -v | |
| - name: Execute Pest Coverage | |
| run: XDEBUG_MODE=coverage ./vendor/bin/pest --coverage --min=${{ env.PEST_MIN_COVERAGE }} | |
| - name: Execute Pest Type Coverage | |
| run: XDEBUG_MODE=coverage ./vendor/bin/pest --type-coverage --min=${{ env.PEST_MIN_TYPE_COVERAGE }} | |
| - name: Store Log Artifacts | |
| if: failure() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Store report artifacts | |
| path: ./storage/logs |