Skip to content
Merged
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
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ inputs:
description: Name of the docker container for webapp
required: false
default: webapp

dev-arg:
description: Parameter to detect dev dependencies
required: false

runs:
using: "composite"
steps:
Expand All @@ -40,6 +43,7 @@ runs:
WORK_DIR: ${{ inputs.work-dir }}
FAST_PARA: ${{ inputs.fastapi-parameter }}
CONTAINER_NAME: ${{ inputs.container-name }}
DEV_ARG: ${{ inputs.dev-arg }}
run: ${{ github.action_path }}/scripts/ValidateCode.sh
shell: bash

Expand Down
8 changes: 6 additions & 2 deletions scripts/ValidateCode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ docker-compose exec -T ${CONTAINER_NAME} python -c "import requests; f=open('${C
[ -d "/mnt/samba/${APP_NAME}" ] || mkdir -p "/mnt/samba/${APP_NAME}"
docker cp "$(docker-compose ps -q ${CONTAINER_NAME})":"/python/app/${CLEAN_BRANCH_NAME}_openapi.json" "/mnt/samba/${APP_NAME}/${CLEAN_BRANCH_NAME}_openapi.json"

if [[ -z $DEV_ARG ]]
then
exit 0
fi

echo "Clean up old reports"
rm -f unittesting.xml coverage.xml typing.xml typing-server.xml typing-integrations.xml

Expand All @@ -24,7 +29,6 @@ echo "Code tests"
if [[ $CONTAINER_NAME != "webapp" ]]; then
echo "flake8 tests" #TODO: remove the if else block once the errors on sb-pim are fixed
docker-compose exec -T ${CONTAINER_NAME} flake8; STATUS1=$? # For Sb-pim only

else
docker-compose exec -T ${CONTAINER_NAME} validatecodeonce; STATUS1=$?
docker cp "$(docker-compose ps -q ${CONTAINER_NAME})":/python/reports/typing.xml typing.xml
Expand All @@ -34,4 +38,4 @@ fi

## Return the status code
TOTAL=$((STATUS1))
exit $TOTAL
exit $TOTAL