Re-add examples

This commit is contained in:
Oliver Davies 2023-01-19 20:04:33 +00:00
parent 579c476a54
commit 4e885eea91
12 changed files with 146 additions and 0 deletions

View file

@ -0,0 +1 @@
export COMPOSE_PROJECT_NAME=php-full

View file

@ -0,0 +1,36 @@
FROM php:8.1-cli-bullseye AS base
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V
WORKDIR /app
ENV PATH="${PATH}:/app/vendor/bin"
COPY composer.* ./
################################################################################
FROM base AS build
RUN apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
git unzip
RUN composer install
################################################################################
FROM base AS test
COPY . .
RUN phpunit --testdox

View file

@ -0,0 +1,25 @@
name: php-full
type: drupal
dockerfile:
stages:
build:
extends: base
packages:
- git
- unzip
commands:
- composer install
test:
extends: base
commands:
- phpunit --testdox
php:
version: 8.1-cli-bullseye
phpstan:
level: 7
paths:
- app
- src

View file

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset name="php-full coding standards">
<description>PHPCS configuration file for php-full.</description>
<file>src</file>
<arg value="np"/>
<rule ref=""/>
</ruleset>

View file

@ -0,0 +1,6 @@
parameters:
level: 7
paths:
- app
- src

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="false"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
failOnRisky="true"
failOnWarning="true"
verbose="true">
<testsuites>
<testsuite name="php-full">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>

View file

@ -0,0 +1 @@
export COMPOSE_PROJECT_NAME=php-simple

View file

@ -0,0 +1,14 @@
FROM php:8.1-cli-bullseye AS base
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN which composer && composer -V
WORKDIR /app
ENV PATH="${PATH}:/app/vendor/bin"
COPY composer.* ./

View file

@ -0,0 +1,4 @@
name: php-simple
type: php-library
php:
version: 8.1-cli-bullseye

View file

@ -0,0 +1,7 @@
<?xml version="1.0"?>
<ruleset name="php-simple coding standards">
<description>PHPCS configuration file for php-simple.</description>
<file>src</file>
<arg value="np"/>
<rule ref=""/>
</ruleset>

View file

@ -0,0 +1,5 @@
parameters:
level:
paths:
- src

View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
cacheResultFile=".phpunit.cache/test-results"
executionOrder="depends,defects"
forceCoversAnnotation="false"
beStrictAboutCoversAnnotation="true"
beStrictAboutOutputDuringTests="false"
beStrictAboutTodoAnnotatedTests="true"
convertDeprecationsToExceptions="true"
failOnRisky="true"
failOnWarning="true"
verbose="true">
<testsuites>
<testsuite name="php-simple">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>