Skip to content

Commit

Permalink
Merge pull request #35 from JamesFreeman/feature/php-8.2
Browse files Browse the repository at this point in the history
Added php 8.2 support
  • Loading branch information
luisdalmolin authored Dec 23, 2022
2 parents a79a268 + 59471f4 commit 9f39096
Show file tree
Hide file tree
Showing 11 changed files with 286 additions and 4 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/php-8.2-couch-mongo-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: push
name: php-8.2-couch-mongo-validate
jobs:
validate:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.2-couch-mongo

steps:
- uses: actions/checkout@v1
- run: goss --gossfile 8.2-couch-mongo/goss.yaml validate
20 changes: 20 additions & 0 deletions .github/workflows/php-8.2-couch-mongo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: php-8.2-couch-mongo-publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: kirschbaumdevelopment/laravel-test-runner
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: 8.2-couch-mongo
tags: "8.2-couch-mongo"
20 changes: 20 additions & 0 deletions .github/workflows/php-8.2-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: php-8.2-publish
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: kirschbaumdevelopment/laravel-test-runner
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
workdir: 8.2
tags: "8.2"
11 changes: 11 additions & 0 deletions .github/workflows/php-8.2-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
on: push
name: php-8.2-validate
jobs:
validate:
runs-on: ubuntu-latest
container:
image: kirschbaumdevelopment/laravel-test-runner:8.2

steps:
- uses: actions/checkout@v1
- run: goss --gossfile 8.2/goss.yaml validate
24 changes: 24 additions & 0 deletions 8.2-couch-mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM kirschbaumdevelopment/laravel-test-runner:8.2

# Install system dependencies for couchbase
RUN apt-get install -y wget
RUN wget -O - https://packages.couchbase.com/clients/c/repos/deb/couchbase.key | apt-key add -
RUN echo "deb https://packages.couchbase.com/clients/c/repos/deb/ubuntu1804 bionic bionic/main" | tee /etc/apt/sources.list.d/couchbase.list
RUN apt-get update
RUN apt-get install -y libcouchbase3 libcouchbase-dev

## Install PECL
RUN apt-get install -y php-pear php8.2-dev php8.2-xml
### Making sure we're using the correct php version
RUN rm /etc/alternatives/php
RUN ln -s /usr/bin/php8.2 /etc/alternatives/php


## MongoDB
RUN pecl install mongodb-1.13.0
RUN echo "extension=mongodb.so" | tee -a /etc/php/8.2/cli/conf.d/20-mongodb.ini


## Couchbase
RUN pecl install couchbase-3.2.0
RUN echo "extension=couchbase.so" | tee -a /etc/php/8.2/cli/conf.d/30-couchbase.ini
41 changes: 41 additions & 0 deletions 8.2-couch-mongo/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
command:
node --version:
exit-status: 0
stdout:
- "v14"
yarn --version:
exit-status: 0
npm --version:
exit-status: 0
stdout:
- "6"
git --version:
exit-status: 0
composer --version:
exit-status: 0
php --version:
exit-status: 0
stdout:
- 8.2
php -m:
exit-status: 0
stdout:
- bcmath
- calendar
- exif
- gd
- iconv
- imap
- intl
- ldap
- mbstring
- mysqli
- pcntl
- pdo_mysql
- pdo_pgsql
- pgsql
- soap
- xml
- zip
- mongodb
- couchbase
33 changes: 33 additions & 0 deletions 8.2-couch-mongo/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Canvas Test Runner

Docker Container with PHP and extensions to be compatible with most Laravel applications. Also installed on this container we have Composer and NodeJS/NPM/Yarn.

## Building and pushing the image

**Build**:

```
docker build --pull -t kirschbaumdevelopment/laravel-test-runner .
```

**Tag**:

```
docker tag kirschbaumdevelopment/laravel-test-runner:latest kirschbaumdevelopment/laravel-test-runner:8.2-couch-mongo
```

**Login**
```
docker login --username=yourhubusername [email protected]
```


**Push**:

```
docker push kirschbaumdevelopment/laravel-test-runner:8.2-couch-mongo
```

## Credits

- [Luis Dalmolin](https://github.com/luisdalmolin)
51 changes: 51 additions & 0 deletions 8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:20.04
LABEL maintainer="Luis Dalmolin <[email protected]>"
ARG DEBIAN_FRONTEND=noninteractive

ENV GOSS_VERSION="0.3.6"

RUN apt-get update && apt-get install -y software-properties-common curl
RUN add-apt-repository ppa:ondrej/php -y
RUN add-apt-repository ppa:git-core/ppa -y
RUN apt-get update -y
RUN apt-get install -y \
unzip \
php8.2-cli \
php8.2-gd \
php8.2-ldap \
php8.2-mbstring \
php8.2-mysql \
php8.2-pgsql \
php8.2-sqlite3 \
php8.2-xml \
php8.2-xsl \
php8.2-zip \
php8.2-curl \
php8.2-soap \
php8.2-gmp \
php8.2-bcmath \
php8.2-intl \
php8.2-imap \
php8.2-phpdbg \
php8.2-bz2 \
php8.2-redis

# composer
ENV COMPOSER_HOME=/composer
ENV PATH=./vendor/bin:/composer/vendor/bin:/root/.yarn/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# mysql client
RUN apt-get install -y mysql-client

# git
RUN apt-get install -y git

# node and yarn
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g yarn

# goss
RUN curl -fsSL https://goss.rocks/install | GOSS_VER=v${GOSS_VERSION} sh
39 changes: 39 additions & 0 deletions 8.2/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
command:
node --version:
exit-status: 0
stdout:
- "v14"
yarn --version:
exit-status: 0
npm --version:
exit-status: 0
stdout:
- "6"
git --version:
exit-status: 0
composer --version:
exit-status: 0
php --version:
exit-status: 0
stdout:
- 8.2
php -m:
exit-status: 0
stdout:
- bcmath
- calendar
- exif
- gd
- iconv
- imap
- intl
- ldap
- mbstring
- mysqli
- pcntl
- pdo_mysql
- pdo_pgsql
- pgsql
- soap
- xml
- zip
31 changes: 31 additions & 0 deletions 8.2/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Laravel Test Runner - PHP 8.2

Docker Container with PHP 8.2 and extensions to be compatible with most Laravel applications. Also installed on this container we have Composer and NodeJS/NPM/Yarn.

## Building and pushing the image

**Build**:

```
docker build --pull -t kirschbaumdevelopment/laravel-test-runner .
```

**Tag**:

```
docker tag kirschbaumdevelopment/laravel-test-runner:latest kirschbaumdevelopment/laravel-test-runner:8.2
```

**Push**:

```
docker push kirschbaumdevelopment/laravel-test-runner:8.2
```

## Credits

- [Pushpak Chhajed](https://github.com/pushpak1300)

## Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more [about us](https://kirschbaumdevelopment.com) or [join us](https://careers.kirschbaumdevelopment.com)!
9 changes: 5 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

This is a [docker container](https://cloud.docker.com/u/kirschbaumdevelopment/repository/docker/kirschbaumdevelopment/laravel-test-runner) for running Laravel tests in Github actions.

| PHP version | Link | Status | Container Tag |
| ----------- | ---- | ------ | ------------- |
| PHP version | Link | Status | Container Tag |
| ---------- |-----------------------------------------------------------------------------------------------| ------ | ------------- |
| 8.2 | [πŸ”—](https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/8.2) | [![Actions Status](https://github.com/kirschbaum-development/laravel-test-runner-container/workflows/php-8.2-validate/badge.svg)](https://github.com/kirschbaum-development/laravel-test-runner-container/actions) | kirschbaumdevelopment/laravel-test-runner:8.2 |
| 8.1 | [πŸ”—](https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/8.1) | [![Actions Status](https://github.com/kirschbaum-development/laravel-test-runner-container/workflows/php-8.1-validate/badge.svg)](https://github.com/kirschbaum-development/laravel-test-runner-container/actions) | kirschbaumdevelopment/laravel-test-runner:8.1 |
| 8.0 | [πŸ”—](https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/8.0) | [![Actions Status](https://github.com/kirschbaum-development/laravel-test-runner-container/workflows/php-8.0-validate/badge.svg)](https://github.com/kirschbaum-development/laravel-test-runner-container/actions) | kirschbaumdevelopment/laravel-test-runner:8.0 |
| 7.4 | [πŸ”—](https://github.com/kirschbaum-development/laravel-test-runner-container/blob/master/7.4) | [![Actions Status](https://github.com/kirschbaum-development/laravel-test-runner-container/workflows/php-7.4-validate/badge.svg)](https://github.com/kirschbaum-development/laravel-test-runner-container/actions) | kirschbaumdevelopment/laravel-test-runner:7.4 |
Expand All @@ -23,14 +24,14 @@ You may want to check [this blog post](https://kirschbaumdevelopment.com/news-ar
In case you need any custom extensions, the container is running Ubuntu, so you can simply install them:

```bash
apt-get install -y php8.1-bz2
apt-get install -y php8.2-bz2
```

Example on Github actions:

```yaml
- name: Install additional PHP extensions
run: apt-get install -y php8.1-bz2 php8.1-soap
run: apt-get install -y php8.2-bz2 php8.2-soap
```
## Issues
Expand Down

0 comments on commit 9f39096

Please sign in to comment.