diff --git a/action.yml b/action.yml index 5a5d0a5..fca85aa 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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 diff --git a/scripts/ValidateCode.sh b/scripts/ValidateCode.sh index f0446c9..7bd60a8 100755 --- a/scripts/ValidateCode.sh +++ b/scripts/ValidateCode.sh @@ -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 @@ -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 @@ -34,4 +38,4 @@ fi ## Return the status code TOTAL=$((STATUS1)) -exit $TOTAL +exit $TOTAL \ No newline at end of file