Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
65 lines
1.6 KiB
YAML
65 lines
1.6 KiB
YAML
name: PHP Unit
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
phpunit:
|
|
runs-on: ubuntu-latest
|
|
|
|
name: PHPUnit test suite
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:latest
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: jbukdev_testing
|
|
ports:
|
|
- 5432:5432
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.3'
|
|
extensions: mbstring, intl, phpredis, imagick
|
|
coverage: xdebug
|
|
tools: phpunit
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Copy .env
|
|
run: php -r "file_exists('.env') || copy('.env.github', '.env');"
|
|
|
|
- name: Get Composer Cache Directory
|
|
id: composer-cache
|
|
run: |
|
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
|
|
|
- name: Cache composer dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
key: ${{ runner.os }}-php-8.3-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-php-8.3-composer-
|
|
|
|
- name: Install Composer Dependencies
|
|
run: composer install --quiet --no-ansi --no-interaction --no-progress
|
|
|
|
- name: Generate Key
|
|
run: php artisan key:generate
|
|
|
|
- name: Setup Directory Permissions
|
|
run: chmod -R 777 storage bootstrap/cache
|
|
|
|
- name: Setup Database
|
|
run: php artisan migrate
|
|
|
|
- name: Execute PHPUnit Tests
|
|
run: vendor/bin/phpunit
|