From 17d4e1ffb7b287b61a033ea693e81f574d253b5d Mon Sep 17 00:00:00 2001 From: LKyz24 Date: Fri, 29 Nov 2024 19:04:47 +0100 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 47 +++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f213b8e..33ca451 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,23 +4,38 @@ on: push: branches: - main - - feature/* - pull_request: # Spustí sa pri vytvorení pull requestu. + - feature/* + pull_request: jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2.12' - - name: Install dependencies - run: composer install - - name: Create SQLite database file - run: | - touch database/database.sqlite - - name: Run tests # Spustí testy cez Laravel Artisan. - run: php artisan test + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2.12' + + - name: Install dependencies + run: composer install + + - name: Create SQLite database file + run: | + touch database/database.sqlite + + - name: Set application key + run: | + php artisan key:generate + + - name: Run migrations + run: php artisan migrate --env=testing + + - name: Run tests + run: php artisan test + + - name: Clear cache + run: php artisan config:clear && php artisan cache:clear