Skip to content

Set new defaults for picked up and tag shortcuts #230

Set new defaults for picked up and tag shortcuts

Set new defaults for picked up and tag shortcuts #230

Workflow file for this run

name: Laravel
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- uses: actions/checkout@v4
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: "Install Dependencies"
if: steps.cache-vendor.outputs.cache-hit != 'true' # Skip if cache hit
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Cache PHPStan
uses: actions/cache@v4
with:
path: ./storage/phpstan
key: "result-cache-${{ github.run_id }}" # always unique key - always writes a new cache
restore-keys: result-cache-
- uses: php-actions/phpstan@v3
with:
php_version: 8.2
path: 'app'
code-quality:
runs-on: ubuntu-latest
needs: phpstan
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- uses: actions/checkout@v4
with:
# Must be used to trigger workflow after push
token: ${{ secrets.ACCESS_TOKEN }}
ref: ${{ github.head_ref }}
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: "Install Dependencies"
if: steps.cache-vendor.outputs.cache-hit != 'true' # Skip if cache hit
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Cache Rector
uses: actions/cache@v4
with:
path: ./storage/rector/cache
key: ${{ runner.os }}-rector-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-rector-
- name: "Run Rector"
run: vendor/bin/rector --ansi
- name: Cache Pint
uses: actions/cache@v4
with:
path: ./storage/pint.cache
key: ${{ runner.os }}-pint-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-pint-
- name: "Run Pint"
run: ./vendor/bin/pint
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: '[ci-review] Rector & Pint'
commit_author: 'GitHub Action <[email protected]>'
commit_user_email: '[email protected]'
tests:
runs-on: ubuntu-latest
needs: code-quality
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- uses: actions/checkout@v4
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
- name: "Install Dependencies"
if: steps.cache-vendor.outputs.cache-hit != 'true' # Skip if cache hit
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- name: Execute tests (Pest)
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/database.sqlite
run: php artisan test --parallel
- name: Check type coverage
run: ./vendor/bin/pest --type-coverage --min=100