2024-01-03 12:30:10 -08:00
|
|
|
name: Tests in SQLite
|
2023-08-23 15:53:34 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php-version:
|
|
|
|
- "8.1.1"
|
|
|
|
|
|
|
|
name: PHP ${{ matrix.php-version }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: "${{ matrix.php-version }}"
|
|
|
|
coverage: none
|
|
|
|
|
2023-09-11 05:25:44 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-23 15:53:34 -07:00
|
|
|
|
|
|
|
- name: Get Composer Cache Directory
|
|
|
|
id: composer-cache
|
|
|
|
run: |
|
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
2024-01-22 00:50:37 -08:00
|
|
|
- uses: actions/cache@v4
|
2023-08-23 15:53:34 -07:00
|
|
|
with:
|
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-composer-
|
|
|
|
|
|
|
|
- name: Copy .env
|
|
|
|
run: |
|
|
|
|
cp -v .env.testing.example .env
|
|
|
|
cp -v .env.testing.example .env.testing
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
|
|
|
|
|
2024-05-28 17:41:01 -07:00
|
|
|
- name: Generate key
|
|
|
|
run: php artisan key:generate
|
|
|
|
|
|
|
|
- name: Setup Passport
|
|
|
|
run: php artisan passport:keys
|
|
|
|
|
|
|
|
- name: Directory Permissions
|
|
|
|
run: chmod -R 777 storage bootstrap/cache
|
2023-08-23 15:53:34 -07:00
|
|
|
|
|
|
|
- name: Execute tests (Unit and Feature tests) via PHPUnit
|
|
|
|
env:
|
2024-01-03 12:27:13 -08:00
|
|
|
DB_CONNECTION: sqlite_testing
|
2023-08-23 15:53:34 -07:00
|
|
|
run: php artisan test --parallel
|