Skip to content
Open
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
1 change: 1 addition & 0 deletions .docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJECT_NAME=
29 changes: 29 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
x-php-base: &php-base
build:
context: .
dockerfile: php/Dockerfile
container_name: ${PROJECT_NAME:-package}_php
volumes:
- ../:/app
environment:
UID: "${UID:-1000}"
GID: "${GID:-1000}"
working_dir: /app

services:
php:
<<: *php-base
build:
context: .
dockerfile: php/Dockerfile
args:
PHP_VERSION: 7.4
container_name: ${PROJECT_NAME:-package}_php74
php83:
<<: *php-base
build:
context: .
dockerfile: php/Dockerfile
args:
PHP_VERSION: 8.3
container_name: ${PROJECT_NAME:-package}_php83
27 changes: 27 additions & 0 deletions .docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ARG PHP_VERSION

FROM php:${PHP_VERSION}-cli

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
unzip \
zip \
libzip-dev \
libonig-dev \
&& docker-php-ext-install zip \
&& pecl install pcov \
&& docker-php-ext-enable pcov \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR /app

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

ARG UID=1000
ARG GID=1000
RUN groupadd -g ${GID} appgroup && \
useradd -u ${UID} -g appgroup -m appuser && \
chown -R appuser:appgroup /app
USER appuser

CMD ["php", "-v"]
22 changes: 22 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

## Directories to ignore when exporting the package
.docker/ export-ignore
.github/ export-ignore
tests/ export-ignore

## Files to ignore when exporting the package
/.env export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/AGENTS.md export-ignore
/bone.json export-ignore
/codeception.* export-ignore
/codeception.yml export-ignore
/example.php export-ignore
/infection.json.dist export-ignore
/Makefile export-ignore
/phpbench.json export-ignore
/phpcs.xml export-ignore
/psalm.xml export-ignore
/index.php export-ignore
/rector.php export-ignore
25 changes: 19 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,39 @@ on:

jobs:
tests:
name: Test on PHP ${{ matrix.php_versions }}
name: Test on PHP ${{ matrix.php }}

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.php_versions == '8.1' }}
continue-on-error: ${{ contains('8.1,8.2', matrix.php) }}
if: "!contains(github.event.head_commit.message, '--skip ci') && !github.event.pull_request.draft"

strategy:
matrix:
php_versions: ['7.4', '8.0', '8.1']
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
dependencies:
- "lowest"
- "highest"
include:
- php: '8.5'
composer-options: "--ignore-platform-reqs"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_versions }}
php-version: ${{ matrix.php }}
coverage: xdebug2

- uses: ramsey/composer-install@v2
- uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: ${{ matrix.composer-options }}

- name: Run test suite
run: vendor/bin/codecept run unit --coverage-text
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.vscode/
/vendor/

/_others/
Expand All @@ -6,4 +7,5 @@
codeception.yml
*.lock
c3.php
rector.php
rector.php
bone.json
Loading
Loading