diff --git a/.env.testing b/.env.testing index c3cb6e0fd..2faee55f6 100644 --- a/.env.testing +++ b/.env.testing @@ -22,7 +22,7 @@ QUEUE_CONNECTION=sync REDIS_SCHEME=tcp REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null -REDIS_PORT=6399 +REDIS_PORT=6379 HORIZON_PREFIX="horizon-test-" diff --git a/.github/workflows/php-larastan.yml b/.github/workflows/php-larastan.yml index 7bbfa7180..e32703360 100644 --- a/.github/workflows/php-larastan.yml +++ b/.github/workflows/php-larastan.yml @@ -1,38 +1,35 @@ -name: PHP - Larastan -permissions: - contents: read - pull-requests: write +name: Static Analysis on: push: - branches: - - main - - dev - - staging + branches: [staging, dev] pull_request: - branches: - - main - - dev - - staging + branches: [staging, dev] jobs: - phpstan: + larastan: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.5' # Or your desired PHP version - extensions: mbstring, pdo_mysql # Add necessary extensions - ini-values: post_max_size=256M, upload_max_filesize=256M + php-version: '8.5' + extensions: mbstring, pdo_sqlite, bcmath, intl coverage: none + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: vendor + key: composer-8.5-${{ hashFiles('composer.lock') }} + restore-keys: composer-8.5- + - name: Install Composer dependencies - run: composer install --no-interaction --no-progress + run: composer install --no-interaction --no-progress --prefer-dist - name: Run Larastan - run: ./vendor/bin/phpstan analyse + run: vendor/bin/phpstan analyse --memory-limit=512M diff --git a/.github/workflows/php-laravel-tests.yml b/.github/workflows/php-laravel-tests.yml index 6c5df7de2..3622b49ed 100644 --- a/.github/workflows/php-laravel-tests.yml +++ b/.github/workflows/php-laravel-tests.yml @@ -2,17 +2,29 @@ name: Laravel Test Suite on: push: - branches: [ staging, dev, unstable ] + branches: [staging, dev, unstable] pull_request: - branches: [ staging, dev, unstable ] + branches: [staging, dev, unstable] jobs: tests: runs-on: ubuntu-latest + services: + redis: + image: redis:8 + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 5s + --health-timeout 3s + --health-retries 5 + strategy: + fail-fast: true matrix: - php: [ '8.5' ] + php: ['8.4', '8.5'] steps: - name: Checkout code @@ -22,17 +34,35 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, intl, gd, exif, iconv, redis coverage: none + ini-values: memory_limit=512M + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: vendor + key: composer-${{ matrix.php }}-${{ hashFiles('composer.lock') }} + restore-keys: composer-${{ matrix.php }}- - name: Install Composer dependencies - run: composer install -n --prefer-dist + run: composer install --no-interaction --no-progress --prefer-dist - - name: Copy .env.testing + - name: Prepare environment run: | cp .env.testing .env php artisan key:generate + touch storage/oauth-private.key storage/oauth-public.key + php -r " + \$key = openssl_pkey_new(['private_key_bits' => 2048, 'private_key_type' => OPENSSL_KEYTYPE_RSA]); + openssl_pkey_export(\$key, \$private); + \$public = openssl_pkey_get_details(\$key)['key']; + file_put_contents('storage/oauth-private.key', \$private); + file_put_contents('storage/oauth-public.key', \$public); + " - name: Run tests - run: php artisan test - continue-on-error: false + run: vendor/bin/pest --compact + env: + REDIS_HOST: 127.0.0.1 + REDIS_PORT: 6379 diff --git a/.github/workflows/php-pint.yml b/.github/workflows/php-pint.yml index faa512cbf..fbc8132b7 100644 --- a/.github/workflows/php-pint.yml +++ b/.github/workflows/php-pint.yml @@ -1,46 +1,35 @@ -name: PHP - Pint -permissions: - contents: read - pull-requests: write +name: Code Style on: push: - branches: - - main - - dev - - staging - - unstable + branches: [staging, dev] pull_request: - branches: - - main - - dev - - staging - - unstable + branches: [staging, dev] jobs: - lint: + pint: runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - php: [8.5] steps: - name: Checkout code - uses: actions/checkout@v7 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} - extensions: json, dom, curl, libxml, mbstring + php-version: '8.5' + extensions: mbstring coverage: none - - name: Install Pint - run: composer global require laravel/pint + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: vendor + key: composer-8.5-${{ hashFiles('composer.lock') }} + restore-keys: composer-8.5- - - name: Run Pint - run: pint --test + - name: Install Composer dependencies + run: composer install --no-interaction --no-progress --prefer-dist - # - name: Commit linted files - # uses: stefanzweifel/git-auto-commit-action@v5 + - name: Run Pint + run: vendor/bin/pint --test diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 3b47058a7..f2d34c5b9 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -2,7 +2,7 @@ services: redis: image: "redis:8" ports: - - "6399:6379" + - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 2s