Add Python 3 verify step to SDC 07/135007/2
authoreschcam <cameron.scholes@est.tech>
Tue, 20 Jun 2023 11:57:54 +0000 (12:57 +0100)
committereschcam <cameron.scholes@est.tech>
Tue, 20 Jun 2023 12:01:31 +0000 (13:01 +0100)
Issue-ID: SDC-4498
Signed-off-by: eschcam <cameron.scholes@est.tech>
Change-Id: I509ac34fd14b15cf968004b6254f749d87bc3d03

jjb/sdc/python3-verify.sh [new file with mode: 0644]
jjb/sdc/sdc.yaml

diff --git a/jjb/sdc/python3-verify.sh b/jjb/sdc/python3-verify.sh
new file mode 100644 (file)
index 0000000..f71c12c
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+py_files=$(find . -name '*.py' -not -path "*/node_modules/*" -not -path "*/target/*")
+
+if python3 -m py_compile ${py_files}
+then
+    echo "All python files compiled successfully"
+    exit 0
+else
+    echo "Failed to compile all files in Python 3"
+    exit 1
+fi
index e865ae8..20a30f4 100644 (file)
     name: sdc
     project-name: "sdc"
     jobs:
+      - "{project-name}-{stream}-{area}-verify-shell":
+          # This is to ensure all script are Python 3 compatible
+          area: verify
+          build-timeout: 45
+          script: !include-raw-escape: "python3-verify.sh"
       - "{project-name}-{stream}-verify-java":
           # this build is unit test only (Verify 1/2)
           mvn-params: "-P skip-integration-tests -Dnpm.registry=https://nexus3.onap.org/repository/npm.public/npm/-/"