Update dependencies #131
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Preflight Tests' | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_DB: tailwind_components | |
POSTGRES_USER: tailwind_components | |
POSTGRES_PASSWORD: tailwind_components | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd="pg_isready" | |
--health-interval=5s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- name: π Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: π§© Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '24.x' | |
- name: π¦ Install PNPM | |
run: npm i pnpm -g | |
- name: π Cache node_modules Directory | |
uses: actions/cache@v4 | |
id: node_modules-cache | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-node_modules-cache-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }} | |
- name: π Install NPM Packages | |
if: steps.node_modules-cache.outputs.cache-hit != 'true' | |
run: pnpm i | |
- name: π Setup Cache Environment | |
id: extcache | |
uses: shivammathur/cache-extensions@v1 | |
with: | |
php-version: 8.3 | |
extensions: bcmath | |
key: php_extensions_cache | |
- name: π Cache Extensions | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.extcache.outputs.dir }} | |
key: ${{ steps.extcache.outputs.key }} | |
restore-keys: ${{ steps.extcache.outputs.key }} | |
- name: π Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.3' | |
extensions: bcmath | |
- name: π Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: π Cache PHP Dependencies | |
uses: actions/cache@v4 | |
id: vendor-cache | |
with: | |
path: vendor | |
key: ${{ runner.OS }}-vendor-${{ hashFiles('**/composer.lock') }} | |
- name: π Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: π¦ Install Composer Dependencies | |
if: steps.vendor-cache.outputs.cache-hit != 'true' | |
run: | | |
composer install --no-interaction --prefer-dist | |
composer remove maantje/xhprof-buggregator-laravel --no-interaction --dev | |
- name: π§ Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: π Generate App Key | |
run: php artisan key:generate | |
- name: π Build Frontend with Vite | |
run: pnpm build | |
- name: π Run Migrations | |
env: | |
DB_CONNECTION: pgsql | |
DB_DATABASE: tailwind_components | |
DB_PORT: 5432 | |
DB_USERNAME: tailwind_components | |
DB_HOST: 127.0.0.1 | |
DB_PASSWORD: tailwind_components | |
run: php artisan migrate:fresh --seed | |
- name: π§ͺ Execute tests (Unit and Feature tests) via Pest | |
env: | |
DB_CONNECTION: pgsql | |
DB_DATABASE: tailwind_components | |
DB_PORT: 5432 | |
DB_USERNAME: tailwind_components | |
DB_HOST: 127.0.0.1 | |
DB_PASSWORD: tailwind_components | |
run: vendor/bin/pest --testdox |