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 3, 2023
1 parent 41dc68f commit 6e7e009
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 4 deletions.
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
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@ $ composer phpspec
$ composer behat
```

## How build new images
```shell
$ docker build -t pugx/poser:php81 -f .docker/base/php81/Dockerfile .
$ docker push pugx/poser:php81
```

## 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 6e7e009

Please sign in to comment.