I have react laravel project. Repo name is UBI. Inside it two folders, ubi for frontend in react, live on AWS amplify, but othere is api that is laravel. here is the copy of laravel.yml file and when the GitHub action pages run this laravel.yml, it fails to find the composer.json that is inside the api folder
This is the copy of my larave.yml file
name: Laravel
on:
push:
branches: [ “main” ]
pull_request:
branches: [ “main” ]
jobs:
laravel-tests:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: '8.2'
- uses: actions/checkout@v4
- name: Navigate to Laravel directory
run: cd api
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: List directory contents
run: ls -la
- name: Navigate to Laravel directory
run: cd api/
- name: List directory contents
run: ls -la
- name: Install Dependencies
run: composer install
# run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mysql -h localhost -u root --password=root -e "CREATE DATABASE laravel_test;"
php artisan migrate --seed --env=testing
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
env:
DB_CONNECTION: mysql
DB_HOST: localhost
DB_PORT: 3306
DB_DATABASE: laravel_test
DB_USERNAME: root
DB_PASSWORD: root
run: php artisan test
Issue is in moving to directory by cd api, As it is printing the files of that directory before and after nevigatin, although it does not changes directory.
Here is the exeuting or running (final) laravel.yml