Skip to content

Commit 7d7db99

Browse files
✨ Include health tests for a PRD docker image (#4)
* add dev parameter * add suggestion from code review * remove empty line * remove unnecessary code * Update scripts/ValidateCode.sh Co-authored-by: Anthony Hillairet <[email protected]> --------- Co-authored-by: Anthony Hillairet <[email protected]>
1 parent cc211ba commit 7d7db99

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ inputs:
2020
description: Name of the docker container for webapp
2121
required: false
2222
default: webapp
23-
23+
dev-arg:
24+
description: Parameter to detect dev dependencies
25+
required: false
26+
2427
runs:
2528
using: "composite"
2629
steps:
@@ -40,6 +43,7 @@ runs:
4043
WORK_DIR: ${{ inputs.work-dir }}
4144
FAST_PARA: ${{ inputs.fastapi-parameter }}
4245
CONTAINER_NAME: ${{ inputs.container-name }}
46+
DEV_ARG: ${{ inputs.dev-arg }}
4347
run: ${{ github.action_path }}/scripts/ValidateCode.sh
4448
shell: bash
4549

scripts/ValidateCode.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ docker-compose exec -T ${CONTAINER_NAME} python -c "import requests; f=open('${C
1515
[ -d "/mnt/samba/${APP_NAME}" ] || mkdir -p "/mnt/samba/${APP_NAME}"
1616
docker cp "$(docker-compose ps -q ${CONTAINER_NAME})":"/python/app/${CLEAN_BRANCH_NAME}_openapi.json" "/mnt/samba/${APP_NAME}/${CLEAN_BRANCH_NAME}_openapi.json"
1717

18+
if [[ -z $DEV_ARG ]]
19+
then
20+
exit 0
21+
fi
22+
1823
echo "Clean up old reports"
1924
rm -f unittesting.xml coverage.xml typing.xml typing-server.xml typing-integrations.xml
2025

@@ -24,7 +29,6 @@ echo "Code tests"
2429
if [[ $CONTAINER_NAME != "webapp" ]]; then
2530
echo "flake8 tests" #TODO: remove the if else block once the errors on sb-pim are fixed
2631
docker-compose exec -T ${CONTAINER_NAME} flake8; STATUS1=$? # For Sb-pim only
27-
2832
else
2933
docker-compose exec -T ${CONTAINER_NAME} validatecodeonce; STATUS1=$?
3034
docker cp "$(docker-compose ps -q ${CONTAINER_NAME})":/python/reports/typing.xml typing.xml
@@ -34,4 +38,4 @@ fi
3438

3539
## Return the status code
3640
TOTAL=$((STATUS1))
37-
exit $TOTAL
41+
exit $TOTAL

0 commit comments

Comments
 (0)