Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: run phpunits #2993

Draft
wants to merge 1 commit into
base: alpha
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
/vendor
/docs
17 changes: 13 additions & 4 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# build docker image based on debian bullseye and bookworm
# 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: Docker Test Image
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:
Expand All @@ -30,21 +34,26 @@ jobs:
run: |
docker build -t jeedom:bullseye --build-arg DEBIAN=bullseye --build-arg DATABASE=1 .
- name: run jeedom:bullseye and check
# build current image for bullseye and check it
# run current image for bullseye and check it
run: |
docker run -p 80:80 -d --rm --name jeedom_bullseye jeedom:bullseye
sleep 45
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
# build current image for bookworm and check it
# run current image for bookworm and check it
run: |
docker run -p 81:80 -d --rm --name jeedom_bookworm jeedom:bookworm
sleep 45
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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ tmp/*

!.htaccess
.env
.phpunit.result.cache
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ EXPOSE 80
EXPOSE 443
COPY --chown=root:root --chmod=550 install/OS_specific/Docker/init.sh /root/
COPY --chown=root:root --chmod=550 install/bashrc /root/.bashrc
CMD ["bash", "/root/init.sh"]
SHELL ["/bin/bash", "-c"]
CMD ["/root/init.sh"]
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
"symfony/expression-language": "5 - 7",
"pragmarx/google2fa-qrcode": "^3",
"bacon/bacon-qr-code": "2 - 3",
"influxdata/influxdb-client-php": "^3",
"psr/log": "^1.1",
"php": ">=7.4"
"influxdb/influxdb-php": "^1.15",
"psr/log": "^1.1"
},
"config": {
"allow-plugins": {
"php-http/discovery": true
},
"platform": {
"php": "7.4"
}
"allow-plugins": {
"php-http/discovery": true
}
},
"require-dev": {
"phpunit/phpunit": "^9.6"
}
}
Loading
Loading