chore: Update dependencies #804
This file contains 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: Laravel Tests | |
on: | |
push: | |
branches: [ master, develop, feature/** ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
laravel-test-sqlite: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Installing PHP | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: '8.2' | |
- name: Get Composer Cache Directory 2 | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
id: actions-cache | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Cache PHP dependencies | |
uses: actions/cache@v3 | |
id: vendor-cache | |
with: | |
path: vendor | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} | |
- name: Setup env file | |
run: cp .env.ci .env | |
- name: Composer install | |
if: steps.vendor-cache.outputs.cache-hit != 'true' | |
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist | |
- name: Setup keys | |
run: php artisan key:generate | |
- name: Fix perms for dirs | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Migrate database | |
env: | |
DB_CONNECTION: 'sqlite' | |
DB_DATABASE: 'db.sqlite' | |
run: touch database/db.sqlite; php artisan migrate | |
- name: Execute tests (Unit and Feature tests) via PHPUnit | |
env: | |
DB_CONNECTION: 'sqlite' | |
DB_DATABASE: 'db.sqlite' | |
run: vendor/phpunit/phpunit/phpunit | |
laravel-test-sql: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mariadb:latest | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
MYSQL_DATABASE: scw__api | |
MYSQL_USER: scw__api | |
MYSQL_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
ports: | |
- 33306:3306 | |
options: >- | |
--health-cmd="mariadb-admin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Installing PHP | |
uses: shivammathur/setup-php@master | |
with: | |
php-version: '8.2' | |
- name: Get Composer Cache Directory 2 | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
id: actions-cache | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Cache PHP dependencies | |
uses: actions/cache@v3 | |
id: vendor-cache | |
with: | |
path: vendor | |
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} | |
- name: Setup env file | |
run: cp .env.ci .env | |
- name: Composer install | |
if: steps.vendor-cache.outputs.cache-hit != 'true' | |
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --prefer-dist | |
- name: Setup keys | |
run: php artisan key:generate | |
- name: Fix perms for dirs | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Migrate database | |
env: | |
DB_CONNECTION: 'mysql' | |
DB_DATABASE: 'scw__api' | |
DB_PORT: 33306 | |
#DB_HOST: 'mysql' | |
DB_USERNAME: 'scw__api' | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
run: touch database/db.sqlite; php artisan migrate | |
- name: Execute tests (Unit and Feature tests) via PHPUnit | |
env: | |
DB_CONNECTION: 'mysql' | |
DB_DATABASE: 'scw__api' | |
DB_PORT: 33306 | |
#DB_HOST: 'mysql' | |
DB_USERNAME: 'scw__api' | |
DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
run: vendor/phpunit/phpunit/phpunit |