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 f71d8a0
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 6 deletions.
2 changes: 1 addition & 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 Down
2 changes: 1 addition & 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 Down
17 changes: 17 additions & 0 deletions .docker/base/php81/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
17 changes: 17 additions & 0 deletions .docker/base/php82/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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

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"
10 changes: 6 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@ 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') }}
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

0 comments on commit f71d8a0

Please sign in to comment.