diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8354976..e31bf03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: pull_request: branches: - main - - develop + - development jobs: frontend: @@ -48,15 +48,16 @@ jobs: working-directory: backend services: - mysql: - image: mysql:8.0 + postgres: + image: postgres:16 env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: testing + POSTGRES_DB: testing + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres ports: - - 3306:3306 + - 5432:5432 options: >- - --health-cmd="mysqladmin ping" + --health-cmd="pg_isready -U postgres" --health-interval=10s --health-timeout=5s --health-retries=3 @@ -69,42 +70,45 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: "8.3" - extensions: mbstring, bcmath, pdo, pdo_mysql + extensions: mbstring, bcmath, pdo, pdo_pgsql coverage: xdebug - name: Copy .env - run: cp .env.example .env.testing + run: cp .env.example .env - name: Install dependencies run: composer install --no-interaction --prefer-dist --optimize-autoloader - name: Generate app key - run: php artisan key:generate --env=testing + run: php artisan key:generate - name: Run migrations - run: php artisan migrate --env=testing --force + run: php artisan migrate --force env: - DB_CONNECTION: mysql + XDEBUG_MODE: off + DB_CONNECTION: pgsql DB_HOST: 127.0.0.1 - DB_PORT: 3306 + DB_PORT: 5432 DB_DATABASE: testing - DB_USERNAME: root - DB_PASSWORD: root + DB_USERNAME: postgres + DB_PASSWORD: postgres - name: Run tests - run: php artisan test --env=testing + run: php artisan test env: - DB_CONNECTION: mysql + XDEBUG_MODE: off + DB_CONNECTION: pgsql DB_HOST: 127.0.0.1 - DB_PORT: 3306 + DB_PORT: 5432 DB_DATABASE: testing - DB_USERNAME: root - DB_PASSWORD: root + DB_USERNAME: postgres + DB_PASSWORD: postgres docker-build: name: Docker Build Check runs-on: ubuntu-latest - needs: [frontend, backend] + needs: [frontend] +# needs: [frontend, backend] steps: - name: Checkout repository @@ -113,5 +117,5 @@ jobs: - name: Build frontend image run: docker build -t queuenova-frontend ./frontend - - name: Build backend image - run: docker build -t queuenova-backend ./backend \ No newline at end of file +# - name: Build backend image +# run: docker build -t queuenova-backend ./backend \ No newline at end of file diff --git a/backend/.env.example b/backend/.env.example index c0660ea..9426f08 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -20,12 +20,12 @@ LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=sqlite -# DB_HOST=127.0.0.1 -# DB_PORT=3306 -# DB_DATABASE=laravel -# DB_USERNAME=root -# DB_PASSWORD= +DB_CONNECTION=pgsql +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_DATABASE=laravel +DB_USERNAME=postgres +DB_PASSWORD= SESSION_DRIVER=database SESSION_LIFETIME=120 diff --git a/backend/phpunit.xml b/backend/phpunit.xml index e7f0a48..48e0914 100644 --- a/backend/phpunit.xml +++ b/backend/phpunit.xml @@ -23,8 +23,12 @@ - - + + + + + + diff --git a/backend/tests/Feature/ExampleTest.php b/backend/tests/Feature/ExampleTest.php index 5790d91..8364a84 100644 --- a/backend/tests/Feature/ExampleTest.php +++ b/backend/tests/Feature/ExampleTest.php @@ -10,10 +10,10 @@ class ExampleTest extends TestCase /** * A basic test example. */ -// public function test_the_application_returns_a_successful_response(): void -// { -// $response = $this->get('/'); -// -// $response->assertStatus(200); -// } + public function test_the_application_returns_a_successful_response(): void + { + $response = $this->get('/'); + + $response->assertStatus(200); + } }