Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Update) GitHub actions #4571

Merged
merged 12 commits into from
Mar 18, 2025
Next Next commit
refactor: github action workflows
  • Loading branch information
HDVinnie committed Mar 18, 2025
commit c3e994886bbd7c1812b22c8ec6a06755fffc5ad7
74 changes: 37 additions & 37 deletions .github/workflows/compile-assets-test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Compile Assets (Vite)
on: [push, pull_request]
on: [ push, pull_request ]
jobs:
build-assets:
strategy:
matrix:
operating-system:
- ubuntu-22.04
php-version:
- '8.4'
name: ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, dom, gd, libxml, mbstring, zip, mysql, xml, intl, bcmath, redis-phpredis/phpredis@6.0.1
ini-values: error_reporting=E_ALL
coverage: pcov
tools: composer:v2
env:
REDIS_CONFIGURE_OPTS: --enable-redis
- name: Configure Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
- name: Install JS Dependencies
run: bun install
- name: Compile Assets (Vite)
run: bun run build
build-assets:
strategy:
matrix:
operating-system:
- ubuntu-22.04
php-version:
- '8.4'
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, dom, gd, libxml, mbstring, zip, mysql, xml, intl, bcmath, redis-phpredis/phpredis@6.0.1
ini-values: error_reporting=E_ALL
coverage: pcov
tools: composer:v2
env:
REDIS_CONFIGURE_OPTS: --enable-redis
- name: Configure Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
- name: Install JS Dependencies
run: bun install
- name: Compile Assets (Vite)
run: bun run build
13 changes: 0 additions & 13 deletions .github/workflows/greetings.yml

This file was deleted.

116 changes: 58 additions & 58 deletions .github/workflows/larastan.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,60 @@
name: PHP Static Analysis (Larastan)
on: [push, pull_request]
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
operating-system:
- ubuntu-22.04
php-version:
- '8.4'
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: unit3d
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:5.0
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: bcmath, ctype, dom, fileinfo, json, libxml, mbstring, openssl, pdo, tokenizer, xml, zip
coverage: none
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Prepare The Laravel Environment
run: cp .env.example .env
- name: Generate Application Key
run: php artisan key:generate
- name: Clear Application Cache
run: php artisan optimize:clear
- name: Run Larastan
run: ./vendor/bin/phpstan analyse -vvv --memory-limit=2G
- name: Cache phpstan cache directory
uses: actions/cache@v4
with:
path: .phpstan.cache
key: "phpstan-cache-${{ github.run_id }}"
restore-keys: |
phpstan-cache-
test:
strategy:
matrix:
operating-system:
- ubuntu-22.04
php-version:
- '8.4'
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: unit3d
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:5.0
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: bcmath, ctype, dom, fileinfo, json, libxml, mbstring, openssl, pdo, tokenizer, xml, zip
coverage: none
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Prepare The Laravel Environment
run: cp .env.example .env
- name: Generate Application Key
run: php artisan key:generate
- name: Clear Application Cache
run: php artisan optimize:clear
- name: Run Larastan
run: ./vendor/bin/phpstan analyse -vvv --memory-limit=2G
- name: Cache phpstan cache directory
uses: actions/cache@v4
with:
path: .phpstan.cache
key: "phpstan-cache-${{ github.run_id }}"
restore-keys: |
phpstan-cache-
60 changes: 30 additions & 30 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: PHP Lint (Pint)
on: [push, pull_request]
on: [ push, pull_request ]
jobs:
build-assets:
pint:
strategy:
matrix:
operating-system:
- ubuntu-22.04
php-version:
- '8.4'
name: ${{ matrix.operating-system }}
name: php ${{ matrix.php-version }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, dom, gd, libxml, mbstring, zip, mysql, xml, intl, bcmath, redis-phpredis/phpredis@6.0.1
ini-values: error_reporting=E_ALL
coverage: pcov
tools: composer:v2
env:
REDIS_CONFIGURE_OPTS: --enable-redis
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
- name: Run Pint
run: ./vendor/bin/pint
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: PHP Style Change (Laravel Pint CI)
commit_user_name: HDVinne
commit_user_email: hdinnovations@protonmail.com
commit_author: HDVinnie <hdinnovations@protonmail.com>
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP 8.4
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: curl, dom, gd, libxml, mbstring, zip, mysql, xml, intl, bcmath, redis-phpredis/phpredis@6.0.1
ini-values: error_reporting=E_ALL
coverage: pcov
tools: composer:v2
env:
REDIS_CONFIGURE_OPTS: --enable-redis
- name: Install Composer Dependencies
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader
- name: Run Pint
run: ./vendor/bin/pint
- name: Commit Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "automation: laravel pint ci"
commit_user_name: unit3d-bot
commit_user_email: unit3d_gh_bot@protonmail.com
commit_author: unit3d-bot <unit3d_gh_bot@protonmail.com>
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.