Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
pint:
name: Code Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: "8.5"
extensions: mbstring, xml, ctype, json, bcmath, pdo, pgsql
tools: composer:v2
coverage: none
- uses: actions/cache@v4
with:
path: vendor
key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- run: composer install --no-progress --prefer-dist
- run: vendor/bin/pint --test

test:
name: Tests (${{ matrix.db }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- db: SQLite
connection: sqlite
config: phpunit.xml
- db: PostgreSQL
connection: pgsql
config: phpunit.pgsql.xml

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: testing
POSTGRES_USER: root
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

env:
DB_CONNECTION: ${{ matrix.connection }}

steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: "8.5"
extensions: mbstring, xml, ctype, json, bcmath, pdo, pgsql, sqlite3
tools: composer:v2
coverage: none
- uses: actions/cache@v4
with:
path: vendor
key: composer-${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- run: composer install --no-progress --prefer-dist
- run: cp .env.example .env
- run: php artisan key:generate
- run: vendor/bin/pest --configuration=${{ matrix.config }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<img src="https://img.shields.io/badge/Sanctum-Auth-000000?style=for-the-badge" alt="Sanctum">
<img src="https://img.shields.io/badge/API-v1-0ea5e9?style=for-the-badge" alt="API v1">
<img src="https://img.shields.io/badge/License-MIT-yellow?style=for-the-badge" alt="MIT">
<img src="https://img.shields.io/github/actions/workflow/status/MahdiiMax/taskify/ci.yml?branch=main&style=for-the-badge" alt="CI">
</p>


Expand Down
40 changes: 40 additions & 0 deletions phpunit.pgsql.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>app</directory>
</include>
</source>
<php>
<env name="APP_ENV" value="testing"/>
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="BROADCAST_CONNECTION" value="null"/>
<env name="CACHE_STORE" value="array"/>
<env name="DB_CONNECTION" value="pgsql"/>
<env name="DB_HOST" value="127.0.0.1"/>
<env name="DB_PORT" value="5432"/>
<env name="DB_DATABASE" value="testing"/>
<env name="DB_USERNAME" value="root"/>
<env name="DB_PASSWORD" value="password"/>
<env name="DB_URL" value=""/>
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="PULSE_ENABLED" value="false"/>
<env name="TELESCOPE_ENABLED" value="false"/>
<env name="NIGHTWATCH_ENABLED" value="false"/>
</php>
</phpunit>
Loading