Skip to content

Commit

Permalink
chore: add workflows pipeline for php 8.1 and 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBellyDev committed Oct 4, 2023
1 parent 41dc68f commit e11334c
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .docker/base/php74/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM circleci/php:7.4-fpm-browsers
FROM php:7.4-fpm

USER root

Expand All @@ -14,4 +14,8 @@ RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/i
# install php requirements
RUN docker-php-ext-install zip iconv gd

# install xdebug
RUN pecl install xdebug-3.1.5 \
&& docker-php-ext-enable xdebug

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
6 changes: 5 additions & 1 deletion .docker/base/php80/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM circleci/php:8.0-fpm-browsers
FROM php:8.0-fpm

USER root

Expand All @@ -14,4 +14,8 @@ RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/i
# install php requirements
RUN docker-php-ext-install zip iconv gd

# install xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
21 changes: 21 additions & 0 deletions .docker/base/php81/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM php:8.1-fpm

USER root

# install system packages
RUN apt-get update \
&& apt-get -y install git wget \
&& apt-get install -qqy libzip-dev libpng-dev libjpeg-dev libfreetype6-dev \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# configure php packages
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/

# install php requirements
RUN docker-php-ext-install zip iconv gd

# install xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
21 changes: 21 additions & 0 deletions .docker/base/php82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM php:8.2-fpm

USER root

# install system packages
RUN apt-get update \
&& apt-get -y install git wget \
&& apt-get install -qqy libzip-dev libpng-dev libjpeg-dev libfreetype6-dev \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

# configure php packages
RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/

# install php requirements
RUN docker-php-ext-install zip iconv gd

# install xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
5 changes: 5 additions & 0 deletions .docker/development/php81/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM pugx/poser:php81

USER root

WORKDIR "/application"
5 changes: 5 additions & 0 deletions .docker/development/php82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM pugx/poser:php82

USER root

WORKDIR "/application"
12 changes: 7 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,45 @@ name: Build

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

jobs:
cs-fix:
runs-on: ubuntu-20.04
name: PHP-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Fix CS
uses: docker://oskarstark/php-cs-fixer-ga

build:

strategy:
matrix:
container: [ "php74", "php80" ]
container: [ "php74", "php80", "php81", "php82" ]

runs-on: ubuntu-latest
container: pugx/poser:${{ matrix.container }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Validate composer.json
run: composer validate

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.container }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.container }}
- name: Install dependencies
run: composer install -n --no-progress --no-suggest
run: composer install --prefer-dist --no-progress

- name: Coding Standard Checks
run: PHP_CS_FIXER_IGNORE_ENV=1 bin/php-cs-fixer fix --verbose --diff --dry-run
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,18 @@ $ composer phpspec
$ composer behat
```

## How build new images on M1
```shell
$ docker run --privileged --rm tonistiigi/binfmt --install all
$ docker buildx create --name mybuilder
$ docker buildx use mybuilder
$ docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--push \
-t pugx/poser:php81 \
-f .docker/base/php81/Dockerfile \
.
```

## ENJOY
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,19 @@ services:
stdin_open: true
volumes:
- .:/application:cached

php81:
build:
context: .docker/development/php81
working_dir: /application
stdin_open: true
volumes:
- .:/application:cached

php82:
build:
context: .docker/development/php82
working_dir: /application
stdin_open: true
volumes:
- .:/application:cached
2 changes: 1 addition & 1 deletion src/Render/LocalSvgRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class LocalSvgRenderer implements RenderInterface
private TextSizeCalculatorInterface $textSizeCalculator;
private string $templatesDirectory;

public function __construct(?TextSizeCalculatorInterface $textSizeCalculator = null, ?string $templatesDirectory = null)
public function __construct(TextSizeCalculatorInterface $textSizeCalculator = null, string $templatesDirectory = null)
{
$this->textSizeCalculator = $textSizeCalculator ?? new GDTextSizeCalculator();
$this->templatesDirectory = $templatesDirectory ?? (__DIR__ . '/../Resources/templates');
Expand Down
6 changes: 3 additions & 3 deletions src/Render/SvgForTheBadgeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class SvgForTheBadgeRenderer extends LocalSvgRenderer
private \EasySVG $easy;

public function __construct(
?\EasySVG $easySVG = null,
?TextSizeCalculatorInterface $textSizeCalculator = null,
?string $templatesDirectory = null
\EasySVG $easySVG = null,
TextSizeCalculatorInterface $textSizeCalculator = null,
string $templatesDirectory = null
) {
parent::__construct($textSizeCalculator, $templatesDirectory);

Expand Down
3 changes: 0 additions & 3 deletions src/UI/SingleCommandApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public function __construct(Command $command, string $version = 'UNKNOWN')
$this->getDefinition()->setArguments();
}

/**
* {@inheritdoc}
*/
protected function getCommandName(InputInterface $input): ?string
{
return $this->commandName;
Expand Down

0 comments on commit e11334c

Please sign in to comment.