Update dependency pestphp/pest to v4 #8185
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: Pest | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main, "feature/**"] | |
jobs: | |
build: | |
name: Build Laravel App | |
runs-on: ubuntu-latest | |
outputs: | |
artifact-name: app-artifact | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
- name: Bootstrap Laravel App | |
run: | | |
php ci.php | |
mkdir -p storage/app storage/framework storage/logs | |
touch storage/.gitkeep | |
touch database/database.sqlite | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: app-artifact | |
path: app-artifact.tar.gz | |
pest: | |
name: Pest (PHP ${{ matrix.php }} on ${{ matrix.os }}) | |
needs: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
php: [8.3, 8.4] | |
os: [ubuntu-latest] | |
fail-fast: false | |
env: | |
DB_DATABASE: testing | |
DB_PASSWORD: secretroot | |
DB_USER: root | |
APP_KEY: base64:1NxfrNErQ0vo1ZnPcLeVhnE7tOZdKlKiFORzPA92krM= | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_DATABASE: testing | |
MYSQL_ROOT_PASSWORD: secretroot | |
ports: | |
- 3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Download App Artifact | |
uses: actions/download-artifact@v5 | |
with: | |
name: app-artifact | |
path: . | |
- name: Extract Artifact | |
run: tar -xzf app-artifact.tar.gz | |
- name: Composer dump-autoload | |
run: composer dump-autoload -o -vvv | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: pcov | |
tools: composer | |
- name: Fix Permissions (Linux only) | |
if: runner.os == 'Linux' | |
run: | | |
[ -d storage ] && chmod -R 755 storage || echo "⚠️ storage not found" | |
[ -d bootstrap ] && chmod -R 755 bootstrap || echo "⚠️ bootstrap not found" | |
chmod +x vendor/bin/pest || true | |
- name: Run Pest | |
run: vendor/bin/pest --coverage-clover=clover.xml | |
env: | |
DB_PORT: ${{ job.services.mysql.ports['3306'] }} | |
DB_HOST: 127.0.0.1 | |
- name: Upload Clover | |
uses: actions/upload-artifact@v4 | |
with: | |
name: clover-report-${{ matrix.php }} | |
path: clover.xml | |
codacy: | |
name: Codacy Coverage | |
needs: pest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Coverage Report | |
uses: actions/download-artifact@v5 | |
with: | |
name: clover-report-8.4 | |
- name: Run codacy-coverage-reporter | |
uses: codacy/[email protected] | |
with: | |
api-token: ${{ secrets.CODACY }} | |
coverage-reports: clover.xml | |
qlty: | |
name: Qlty Coverage | |
needs: pest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Coverage Report | |
uses: actions/download-artifact@v5 | |
with: | |
name: clover-report-8.4 | |
- name: QLTY Coverage | |
uses: qltysh/qlty-action/coverage@v2 | |
with: | |
token: ${{ secrets.QLTY }} | |
files: clover.xml |