mirror of https://github.com/pixelfed/pixelfed
ci: refactor GitHub Actions with Redis service and best practices
- Tests workflow: add Redis service, cache composer deps, test PHP 8.4+8.5, generate Passport keys, use vendor/bin/pest directly - Larastan workflow: cache deps, consistent checkout@v4, memory limit - Pint workflow: use project's installed Pint (not global), cache deps - Standardize Redis port to 6379 across CI and local docker-compose - Remove 'unstable' branch from triggers (unused) - Remove 'main' branch from static analysis (doesn't exist)pull/6856/head
parent
18c288f88f
commit
c7473cd1a8
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue