Skip to content

Commit

Permalink
Merge pull request #62 from deefernando6/php-8.2-rhel-8
Browse files Browse the repository at this point in the history
Added the rhel8-php8.2 supported version
  • Loading branch information
ChanakaR authored Jan 15, 2025
2 parents 13cbbcb + 2d3c606 commit 2b67101
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 21 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ name: OrangeHRM DEV Image Build Workflow

on:
push:
branches: [ php-7.4-rhel-8 ]
branches: [ php-8.2-rhel-8 ]
schedule:
- cron: '30 0 * * MON' # 0030 in UTC, 0600 in IST
workflow_dispatch:

env:
REGISTRY: hub.docker.com
DOCKER_HUB_REPO: "orangehrm/orangehrm-environment-images"
TAG_NAME: "dev-php-7.4.33-rhel-8"
LATEST_TAG_NAME: "dev-php-latest-rhel-8"
DOCKER_HUB_REPO: "orangehrm/dev-environment"
LATEST_TAG_NAME: "rhel8-php8.2-latest"
UPSTREAM_REPO: "orangehrm/orangehrm-dev-environment"
UPSTREAM_BRANCH: "refs/heads/php-7.4-rhel-8"
UPSTREAM_BRANCH: "refs/heads/php-8.2-rhel-8"
OS_VERSION: "rhel8"

jobs:

Expand All @@ -35,7 +35,7 @@ jobs:
run: composer install

- name: Build docker image
run: docker build -t ${{ env.DOCKER_HUB_REPO }}:${{ env.TAG_NAME }} --build-arg REDHAT_USERNAME=${{ secrets.REDHAT_USERNAME }} --build-arg REDHAT_PASSWORD=${{ secrets.REDHAT_PASSWORD }} docker-image
run: docker build -t ${{ env.DOCKER_HUB_REPO }}:${{ env.LATEST_TAG_NAME }} --build-arg REDHAT_USERNAME=${{ secrets.REDHAT_USERNAME }} --build-arg REDHAT_PASSWORD=${{ secrets.REDHAT_PASSWORD }} docker-image

- name: Spin up the container
run: |
Expand All @@ -48,12 +48,16 @@ jobs:
php vendor/bin/codecept run unit
- name: Get installed php version
run: echo "VERSION_TAG_NAME=dev-php-$(docker exec dev_web_rhel php -r 'echo PHP_VERSION;')-rhel-8" >> $GITHUB_ENV
run: echo "PHP_VERSION=${{ env.OS_VERSION }}-php$(docker exec $(docker ps --format '{{.Names}}' | head -n 1) php -r 'echo PHP_VERSION;')" >> $GITHUB_ENV

- name: Set TAG_NAME with date
run: |
CURRENT_DATE=$(date +'%d%m%y')
echo VERSION_TAG_NAME="${{ env.PHP_VERSION }}-${CURRENT_DATE}" >> $GITHUB_ENV
- name: New image with a version tag & latest tag
run: |
docker tag ${{ env.DOCKER_HUB_REPO }}:${{ env.TAG_NAME }} ${{ env.DOCKER_HUB_REPO }}:${{ env.VERSION_TAG_NAME }}
docker tag ${{ env.DOCKER_HUB_REPO }}:${{ env.TAG_NAME }} ${{ env.DOCKER_HUB_REPO }}:${{ env.LATEST_TAG_NAME }}
docker tag ${{ env.DOCKER_HUB_REPO }}:${{ env.LATEST_TAG_NAME }} ${{ env.DOCKER_HUB_REPO }}:${{ env.VERSION_TAG_NAME }}
- name: Docker hub login
if: ${{ github.repository == env.UPSTREAM_REPO && github.ref == env.UPSTREAM_BRANCH }}
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
web:
image: orangehrm/orangehrm-environment-images:dev-php-7.4.33-rhel-8
image: orangehrm/dev-environment:rhel8-php8.2-latest
ports:
- "443:443"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docker-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM orangehrm/orangehrm-environment-images:test-php-latest-rhel-8
FROM orangehrm/test-environment:rhel8-php8.2-latest

LABEL maintainer = "orangehrm"
LABEL authors = "OrangeHRM TechOps<[email protected]>"
Expand Down
Binary file modified docker-image/infection.phar
Binary file not shown.
31 changes: 21 additions & 10 deletions tests/unit/WebContainerCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ public function checkContainerIsRunning(UnitTester $I){
}

public function checkPHPVersion(UnitTester $I){
$I->wantTo("verify php 7.4 is installed in the container");
$I->wantTo("verify php 8.2 is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel php --version");
$I->seeInShellOutput('PHP 7.4');
$I->seeInShellOutput('PHP 8.2');
}

public function checkXdebugVersion(AcceptanceTester $I){
$I->wantTo("verify xdebug is installed in the image");
$I->runShellCommand("docker exec dev_web_rhel bash -c 'dnf info php-pecl-xdebug | grep Version'");
$I->seeInShellOutput('Version');
$I->seeInShellOutput('2');
$I->runShellCommand("docker exec dev_web_rhel bash -c 'pecl list | grep xdebug'");
$I->seeInShellOutput('xdebug 3.4.0');
}

public function checkApacheServiceIsRunning(UnitTester $I){
Expand All @@ -52,14 +51,26 @@ public function checkCronServiceIsRunning(UnitTester $I){

public function checkPHPUnit3Version(UnitTester $I){
$I->wantTo("verify phpunit library is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel phpunit3 --version");
$I->seeInShellOutput('PHPUnit 3.7.28');
$I->runShellCommand("docker exec dev_web_rhel phpunit8 --version");
$I->seeInShellOutput('PHPUnit 8.5.41');
}

public function checkPHPUnitVersion(UnitTester $I){
$I->wantTo("verify phpunit library is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel phpunit --version");
$I->seeInShellOutput('PHPUnit 5.7.21');
$I->runShellCommand("docker exec dev_web_rhel phpunit9 --version");
$I->seeInShellOutput('PHPUnit 9.6.22');
}

public function checkPHPUnit10Version(UnitTester $I){
$I->wantTo("verify phpunit 10 library is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel phpunit10 --version");
$I->seeInShellOutput('PHPUnit 10.5.39');
}

public function checkPHPUnit11Version(UnitTester $I){
$I->wantTo("verify phpunit 11 library is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel phpunit11 --version");
$I->seeInShellOutput('PHPUnit 11.5.1');
}

public function checkGitInstallation(UnitTester $I){
Expand Down Expand Up @@ -106,7 +117,7 @@ public function checkBowerVersion(UnitTester $I){
public function checkInfectionFrameworkInstallation(UnitTester $I){
$I->wantTo("verify infection framework is installed in the container");
$I->runShellCommand("docker exec dev_web_rhel infection --version");
$I->seeInShellOutput('0.13.0');
$I->seeInShellOutput('0.29.0');
}

}

0 comments on commit 2b67101

Please sign in to comment.