Skip to content

Commit

Permalink
Update laravel-tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
nanorocks authored Nov 16, 2024
1 parent 470512c commit c203b7f
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/laravel-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,40 @@ jobs:
echo "DB_DATABASE=$(pwd)/database/database.sqlite" >> .env
fi
# Step 3: Set up PHP and required extensions
# Step 3: Set up PHP and Composer (Ensure Composer 2.x is used)
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: mbstring, pdo, pdo_mysql, pdo_sqlite, bcmath, fileinfo, openssl
tools: composer

# Step 4: Skip Composer cache if it's slowing down
# - name: Cache Composer Dependencies
# id: composer-cache
# uses: actions/cache@v3
# with:
# path: ./bca/vendor
# key: ${{ runner.os }}-php-${{ hashFiles('./bca/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-php-
# Ensure Composer 2.x is used
- name: Ensure Composer 2.x
run: |
composer --version # Check Composer version
if [[ $(composer --version) =~ "1." ]]; then
composer self-update --2 # Force Composer 2.x if version 1.x is detected
fi
# Step 4: Cache Composer dependencies (optional)
- name: Cache Composer Dependencies
id: composer-cache
uses: actions/cache@v3
with:
path: ./bca/vendor
key: ${{ runner.os }}-php-${{ hashFiles('./bca/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
# Step 5: Install dependencies with optional parallel installation
# Step 5: Install dependencies (with parallel for Composer 2.x)
- name: Install Dependencies
working-directory: ./bca
run: composer install --no-ansi --no-interaction --prefer-dist --optimize-autoloader --no-scripts --parallel
run: |
if composer --version | grep -q 'Composer 2'; then
composer install --no-ansi --no-interaction --prefer-dist --optimize-autoloader --no-scripts --parallel
else
composer install --no-ansi --no-interaction --prefer-dist --optimize-autoloader --no-scripts
# Step 6: Generate application key
- name: Generate Application Key
Expand Down

0 comments on commit c203b7f

Please sign in to comment.