diff --git a/.ci/run-shellcheck b/.ci/run-shellcheck new file mode 100755 index 00000000..c6c33529 --- /dev/null +++ b/.ci/run-shellcheck @@ -0,0 +1,21 @@ +#!/bin/sh + +cd "$(git rev-parse --show-toplevel)" + +shellcheck "$@" \ + LibOS/shim/test/apps/bash/scripts/bash_test.sh \ + LibOS/shim/test/apps/common_tools/benchmark-http.sh \ + LibOS/shim/test/apps/python-simple/run-tests.sh \ + LibOS/shim/test/native/*.sh \ + Pal/ipc/linux/*.sh \ + Pal/src/host/FreeBSD/pal-gdb.template \ + Pal/src/host/Linux-SGX/debugger/gdb \ + Pal/src/host/Linux-SGX/sgx-driver/load.sh \ + Runtime/pal_loader \ + Scripts/clean-check \ + Scripts/clean-check-prepare \ + Scripts/clean-check-test-copy \ + Scripts/list-all-graphene.sh \ + Scripts/memusg \ + .ci/run-pylint \ + .ci/run-shellcheck diff --git a/Jenkinsfiles/Linux b/Jenkinsfiles/Linux index a0f9ced8..e1a14520 100644 --- a/Jenkinsfiles/Linux +++ b/Jenkinsfiles/Linux @@ -3,6 +3,14 @@ pipeline { dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile' } } stages { + stage('Lint') { + steps { + sh ''' + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter + ''' + } + } stage('Build') { steps { sh ''' diff --git a/Jenkinsfiles/Linux-18.04 b/Jenkinsfiles/Linux-18.04 index b978b8a6..a4bd1542 100644 --- a/Jenkinsfiles/Linux-18.04 +++ b/Jenkinsfiles/Linux-18.04 @@ -8,6 +8,9 @@ pipeline { sh ''' ./.ci/run-pylint -f text || : ./.ci/run-pylint -f json | ./.ci/prfilter + + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter ''' } } diff --git a/Jenkinsfiles/Linux-Debug b/Jenkinsfiles/Linux-Debug index b02bfbc6..a3e75920 100644 --- a/Jenkinsfiles/Linux-Debug +++ b/Jenkinsfiles/Linux-Debug @@ -3,6 +3,14 @@ pipeline { dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile' } } stages { + stage('Lint') { + steps { + sh ''' + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter + ''' + } + } stage('Build') { steps { sh ''' diff --git a/Jenkinsfiles/Linux-Debug-18.04 b/Jenkinsfiles/Linux-Debug-18.04 index 11305dbe..be7c15a7 100644 --- a/Jenkinsfiles/Linux-Debug-18.04 +++ b/Jenkinsfiles/Linux-Debug-18.04 @@ -8,6 +8,9 @@ pipeline { sh ''' ./.ci/run-pylint -f text || : ./.ci/run-pylint -f json | ./.ci/prfilter + + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter ''' } } diff --git a/Jenkinsfiles/Linux-SGX b/Jenkinsfiles/Linux-SGX index 211a19c1..1b72328c 100644 --- a/Jenkinsfiles/Linux-SGX +++ b/Jenkinsfiles/Linux-SGX @@ -6,6 +6,14 @@ pipeline { } } stages { + stage('Lint') { + steps { + sh ''' + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter + ''' + } + } stage('Build') { steps { sh ''' diff --git a/Jenkinsfiles/Linux-SGX-18.04 b/Jenkinsfiles/Linux-SGX-18.04 index 31baa392..0abe5b6c 100644 --- a/Jenkinsfiles/Linux-SGX-18.04 +++ b/Jenkinsfiles/Linux-SGX-18.04 @@ -11,6 +11,9 @@ pipeline { sh ''' ./.ci/run-pylint -f text || : ./.ci/run-pylint -f json | ./.ci/prfilter + + ./.ci/run-shellcheck || : + ./.ci/run-shellcheck -f json | ./.ci/prfilter ''' } } diff --git a/Jenkinsfiles/ubuntu-16.04.dockerfile b/Jenkinsfiles/ubuntu-16.04.dockerfile index 4293b5e6..01638fe8 100644 --- a/Jenkinsfiles/ubuntu-16.04.dockerfile +++ b/Jenkinsfiles/ubuntu-16.04.dockerfile @@ -35,6 +35,7 @@ RUN apt-get update \ python3-pip \ python3-pytest \ python3-scipy \ + shellcheck \ texinfo \ wget \ zlib1g \ diff --git a/Jenkinsfiles/ubuntu-18.04.dockerfile b/Jenkinsfiles/ubuntu-18.04.dockerfile index 02c68803..2b0345b3 100644 --- a/Jenkinsfiles/ubuntu-18.04.dockerfile +++ b/Jenkinsfiles/ubuntu-18.04.dockerfile @@ -37,6 +37,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \ python3-protobuf \ python3-pytest \ python3-scipy \ + shellcheck \ texinfo \ wget \ zlib1g \