feat: run phpunits #381
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build docker image based on debian bullseye or bookworm | |
# start both containers and run sick.php | |
# install composer dev depedencies and run phpunits into running containers | |
# stop & clean | |
name: Integrated PHPUnit | |
on: | |
# only trigger CI when pull request on following branches | |
pull_request: | |
branches: | |
- 'alpha' | |
push: | |
branches: | |
- 'feat/run_phpunit' | |
# this is to manually trigger the worklow | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Reason' | |
default: 'Manual launch' | |
jobs: | |
buildAndTestDockerImg: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
# Check out the repo, using current branch | |
# https://github.com/marketplace/actions/checkout | |
uses: actions/checkout@v4 | |
- name: Build jeedom:bullseye | |
# build current image for bullseye | |
run: | | |
docker build -t jeedom:bullseye --build-arg DEBIAN=bullseye --build-arg DATABASE=1 . | |
- name: run jeedom:bullseye and check | |
# run current image for bullseye and check it | |
run: | | |
docker run -p 80:80 -d --rm --name jeedom_bullseye jeedom:bullseye | |
until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bullseye`" == "healthy" ]; do | |
echo "waiting container to be healthy..." | |
sleep 5; | |
done; | |
docker exec jeedom_bullseye php sick.php | |
docker exec jeedom_bullseye /bin/bash -c "COMPOSER_NO_DEV=0 && composer install" | |
docker exec jeedom_bullseye ./vendor/bin/phpunit --testsuite integration | |
- name: Build jeedom:bookworm | |
# build current image for bookworm | |
run: | | |
docker build -t jeedom:bookworm --build-arg DEBIAN=bookworm --build-arg DATABASE=1 . | |
- name: run jeedom:bookworm and check | |
# run current image for bookworm and check it | |
run: | | |
docker run -p 81:80 -d --rm --name jeedom_bookworm jeedom:bookworm | |
until [ "`docker inspect -f {{.State.Health.Status}} jeedom_bullseye`" == "healthy" ]; do | |
echo "waiting container to be healthy..." | |
sleep 5; | |
done; | |
docker exec jeedom_bookworm php sick.php | |
docker exec jeedom_bookworm /bin/bash -c "COMPOSER_NO_DEV=0 && composer install" | |
docker exec jeedom_bookworm ./vendor/bin/phpunit --testsuite integration | |
- name: Clean docker image | |
continue-on-error: true | |
run: | | |
docker stop jeedom_bullseye jeedom_bookworm || true | |
docker rm jeedom_bullseye jeedom_bookworm || true | |
docker rmi jeedom:bullseye jeedom:bookworm || true |