diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml index 5c2e16d..2ab33fd 100644 --- a/.github/workflows/build-workflow.yml +++ b/.github/workflows/build-workflow.yml @@ -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: @@ -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: | @@ -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 }} diff --git a/docker-compose.yml b/docker-compose.yml index d144a81..82e3b17 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/docker-image/Dockerfile b/docker-image/Dockerfile index 2f310f8..68576af 100644 --- a/docker-image/Dockerfile +++ b/docker-image/Dockerfile @@ -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" diff --git a/docker-image/infection.phar b/docker-image/infection.phar index a13d94e..32b5cc7 100755 Binary files a/docker-image/infection.phar and b/docker-image/infection.phar differ diff --git a/tests/unit/WebContainerCest.php b/tests/unit/WebContainerCest.php index 7f59f4e..6962438 100644 --- a/tests/unit/WebContainerCest.php +++ b/tests/unit/WebContainerCest.php @@ -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){ @@ -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){ @@ -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'); } }