name: General Workflow on: [ push, pull_request ] jobs: security-checker: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - name: The PHP Security Checker uses: symfonycorp/security-checker-action@v5 larastan: runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.3' extensions: mbstring, dom, fileinfo coverage: none - name: Configure Laravel Nova Authentication shell: bash env: NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} run: composer config http-basic.nova.laravel.com "$NOVA_USERNAME" "$NOVA_LICENSE_KEY" - name: Get Composer Cache Directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer Dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Prepare Laravel Environment run: | php -r "file_exists('.env') || copy('.env.ci', '.env');" php artisan key:generate php artisan config:cache php artisan route:cache - name: Clear Laravel Config run: php artisan config:clear - name: Execute Code Static Analysis with Larastan run: ./vendor/bin/phpstan analyse -c ./phpstan.neon --no-progress --error-format=github pint-fixer: runs-on: ubuntu-24.04 permissions: contents: write steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.3' extensions: mbstring, dom, fileinfo tools: pint coverage: none - name: Configure Laravel Nova Authentication shell: bash env: NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} run: composer config http-basic.nova.laravel.com "$NOVA_USERNAME" "$NOVA_LICENSE_KEY" - name: Get Composer Cache Directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer Dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Prepare Laravel Environment run: | php -r "file_exists('.env') || copy('.env.ci', '.env');" php artisan key:generate php artisan config:cache php artisan route:cache - name: Clear Laravel Config run: php artisan config:clear - name: Run Pint Code Style Fixer run: pint - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Pint PHP Style Fixes [no ci] commit_user_name: Pint Bot skip_fetch: true file_pattern: '*.php' laravel-tests: runs-on: ubuntu-24.04 services: mysql: image: mysql:8.3 env: MYSQL_ALLOW_EMPTY_PASSWORD: yes MYSQL_DATABASE: testing ports: - 33306:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: php-version: '8.3' extensions: mbstring, dom, fileinfo coverage: none - name: Configure Laravel Nova Authentication shell: bash env: NOVA_USERNAME: ${{ secrets.NOVA_USERNAME }} NOVA_LICENSE_KEY: ${{ secrets.NOVA_LICENSE_KEY }} run: composer config http-basic.nova.laravel.com "$NOVA_USERNAME" "$NOVA_LICENSE_KEY" - name: Get Composer Cache Directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache composer dependencies uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - name: Install Composer Dependencies run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Get NPM Cache Directory id: npm-cache run: echo "::set-output name=dir::$(npm config get cache)" - name: Cache NPM Dependencies uses: actions/cache@v4 with: path: ${{ steps.npm-cache.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-node- - name: Install npm dependencies run: npm ci - name: Prepare Laravel Environment run: | php -r "file_exists('.env') || copy('.env.ci', '.env');" php artisan key:generate php artisan config:cache php artisan route:cache - name: Run Migrations run: php artisan migrate -v env: DB_CONNECTION: mysql DB_DATABASE: testing DB_PORT: 33306 DB_USER: root - name: Link Storage run: php artisan storage:link - name: Serve Application run: php artisan serve & sleep 5 - name: Run Tests run: php artisan test