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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
tests:
name: PHP ${{ matrix.php }} Tests
runs-on: ubuntu-latest

strategy:
matrix:
php: ['8.3']

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring
coverage: xdebug
tools: composer:v2

- name: Validate composer.json
run: composer validate --strict

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run PHPStan
run: vendor/bin/phpstan analyse

- name: Run PHPUnit
run: vendor/bin/phpunit --coverage-text
20 changes: 19 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,22 @@ vendor/
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
nbproject/
nbproject/

# Testing
var/
.phpunit.result.cache

# IDE
.idea/
.vscode/
*.swp
*.swo

# OS
.DS_Store
Thumbs.db

# Docker
.env
docker-compose.override.yml
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM php:8.3-cli-alpine

RUN apk add --no-cache \
bash \
git \
unzip \
$PHPIZE_DEPS

RUN pecl install pcov \
&& docker-php-ext-enable pcov

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

WORKDIR /app
21 changes: 18 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,27 @@
}
],
"require": {
"php": ">=5.4.0",
"php": ">=8.3.0",
"datingvip/curl": "^2.0"
},
"require-dev": {
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^11.0"
},
"autoload": {
"psr-0": {
"DatingVIP": "src"
"psr-4": {
"DatingVIP\\API\\": "src/DatingVIP/API/"
}
},
"autoload-dev": {
"psr-4": {
"DatingVIP\\API\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
}
}
Loading