From 7bf3084f8ca506896b16b12a6b17329f7fb263f6 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:11:56 +0530 Subject: [PATCH 01/10] Update check_git_clean.sh --- .buildscript/check_git_clean.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.buildscript/check_git_clean.sh b/.buildscript/check_git_clean.sh index 8668c07c9d..72dc38daa0 100755 --- a/.buildscript/check_git_clean.sh +++ b/.buildscript/check_git_clean.sh @@ -1,3 +1,5 @@ +#!/bin/sh -eu + if [ -n "$(git status --porcelain)" ]; then echo 'warning: source tree contains uncommitted changes; .gitignore patterns may need to be fixed' git status From bb17fd12b0fe2a02a67f6aa4e7975da4aa67c178 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:13:09 +0530 Subject: [PATCH 02/10] Update continuous-integration.yml --- .github/workflows/continuous-integration.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 185735733e..19756a7c57 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -53,6 +53,11 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: build + - name: Run shellcheck + uses: gradle/gradle-build-action@v2 + with: + arguments: shellcheck + if: runner.os = 'Linux' - name: Report jacoco coverage uses: gradle/gradle-build-action@v2 env: From d89592b9d06e1ea828c9517d6ebddc7a8fbba0da Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:14:36 +0530 Subject: [PATCH 03/10] Update build.gradle --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 07f6250836..fd309c61fb 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ plugins { id "com.github.kt3k.coveralls" version "2.12.0" apply false id "me.champeau.jmh" version "0.7.1" apply false id "com.github.ben-manes.versions" version "0.47.0" + id "com.felipefzdz.gradle.shellcheck" version "1.4.6" } repositories { @@ -121,6 +122,16 @@ spotless { spotlessPredeclare { java { googleJavaFormat('1.17.0') } } + +shellcheck { + useDocker = false + shellcheckBinary = "shellcheck" + sourceFiles = + fileTree(".") { + include("**/*.sh") + } +} + //////////////////////////////////////////////////////////////////////// // // Google Java Format pre-commit hook installation From 523d4179b63537a0c5bd5b33634df04ae734eaa6 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:15:48 +0530 Subject: [PATCH 04/10] Update run_main_benchmarks.sh --- .github/workflows/run_main_benchmarks.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_main_benchmarks.sh b/.github/workflows/run_main_benchmarks.sh index 27d58187aa..d96a82a41f 100644 --- a/.github/workflows/run_main_benchmarks.sh +++ b/.github/workflows/run_main_benchmarks.sh @@ -1,9 +1,9 @@ #!/bin/bash -cd $BRANCH_NAME/ +cd "$BRANCH_NAME/" || exit mkdir main -cd main/ +cd main/ || exit git clone git@github.com:Uber/NullAway.git -cd NullAway/ +cd NullAway/ || exit ./gradlew jmh --no-daemon From 992b9ab45a10f2ae90ce4b230a2d343aacc8de01 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:17:29 +0530 Subject: [PATCH 05/10] Update get_repo_details.sh --- .github/workflows/get_repo_details.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/get_repo_details.sh b/.github/workflows/get_repo_details.sh index 55521665f4..fc448af858 100644 --- a/.github/workflows/get_repo_details.sh +++ b/.github/workflows/get_repo_details.sh @@ -16,5 +16,5 @@ REPO_FULL_NAME=$(echo "$PR_DETAILS" | jq -r .head.repo.full_name) BRANCH_NAME=$(echo "$PR_DETAILS" | jq -r .head.ref) # Export vars to GITHUB_ENV so they can be used by later scripts -echo "REPO_FULL_NAME=$REPO_FULL_NAME" >> $GITHUB_ENV -echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV +echo "REPO_FULL_NAME=$REPO_FULL_NAME" >> "$GITHUB_ENV" +echo "BRANCH_NAME=$BRANCH_NAME" >> "$GITHUB_ENV" From 27e9ea7d818fcde2e75a52740f6b12964a782a5d Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:18:24 +0530 Subject: [PATCH 06/10] Update run_pr_benchmarks.sh --- .github/workflows/run_pr_benchmarks.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_pr_benchmarks.sh b/.github/workflows/run_pr_benchmarks.sh index 0627db598c..62dfcbb372 100644 --- a/.github/workflows/run_pr_benchmarks.sh +++ b/.github/workflows/run_pr_benchmarks.sh @@ -1,9 +1,9 @@ #!/bin/bash -cd $BRANCH_NAME/ +cd "$BRANCH_NAME/" || exit mkdir pr -cd pr/ -git clone --branch $BRANCH_NAME --single-branch git@github.com:$REPO_NAME.git NullAway -cd NullAway/ +cd pr/ || exit +git clone --branch "$BRANCH_NAME" --single-branch git@github.com:"$REPO_NAME".git NullAway +cd NullAway/ || exit ./gradlew jmh --no-daemon From e8a121525fcbc42b6090cde05421427f0a18400d Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:19:34 +0530 Subject: [PATCH 07/10] Update run_gcp_benchmarks.sh --- .github/workflows/run_gcp_benchmarks.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_gcp_benchmarks.sh b/.github/workflows/run_gcp_benchmarks.sh index 059e72c4f6..9dc8604f87 100644 --- a/.github/workflows/run_gcp_benchmarks.sh +++ b/.github/workflows/run_gcp_benchmarks.sh @@ -7,14 +7,14 @@ chmod +x ./.github/workflows/gcloud_ssh.sh ./.github/workflows/gcloud_ssh.sh "export BRANCH_NAME=${BRANCH_NAME} && mkdir $BRANCH_NAME" # Using gcloud compute scp to copy the bash scripts that will run the benchmarks onto the GCCE -gcloud compute scp ./.github/workflows/run_pr_benchmarks.sh root@nullway-jmh:$BRANCH_NAME/ --zone=us-central1-a -gcloud compute scp ./.github/workflows/run_main_benchmarks.sh root@nullway-jmh:$BRANCH_NAME/ --zone=us-central1-a +gcloud compute scp ./.github/workflows/run_pr_benchmarks.sh root@nullway-jmh:"$BRANCH_NAME/" --zone=us-central1-a +gcloud compute scp ./.github/workflows/run_main_benchmarks.sh root@nullway-jmh:"$BRANCH_NAME/" --zone=us-central1-a # Running the benchmark script for the pull request branch and main branch on GCCE ./.github/workflows/gcloud_ssh.sh " export BRANCH_NAME=${BRANCH_NAME} && export REPO_NAME=${REPO_FULL_NAME} && chmod +x $BRANCH_NAME/run_pr_benchmarks.sh && $BRANCH_NAME/run_pr_benchmarks.sh && cd && chmod +x $BRANCH_NAME/run_main_benchmarks.sh && $BRANCH_NAME/run_main_benchmarks.sh" # Copying the benchmark results from GCCE back to the Github runner for the PR branch -gcloud compute scp root@nullway-jmh:$BRANCH_NAME/pr/NullAway/jmh/build/results/jmh/results.txt ./pr_text.txt --zone=us-central1-a +gcloud compute scp root@nullway-jmh:"$BRANCH_NAME/pr/NullAway/jmh/build/results/jmh/results.txt" ./pr_text.txt --zone=us-central1-a # Copying the benchmark results from GCCE back to the Github runner for the main branch -gcloud compute scp root@nullway-jmh:$BRANCH_NAME/main/NullAway/jmh/build/results/jmh/results.txt ./main_text.txt --zone=us-central1-a +gcloud compute scp root@nullway-jmh:"$BRANCH_NAME/main/NullAway/jmh/build/results/jmh/results.txt" ./main_text.txt --zone=us-central1-a From 64a202b573603a30c6f9643e5a2ac341392ca15a Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 20:58:49 +0530 Subject: [PATCH 08/10] Update .github/workflows/continuous-integration.yml Co-authored-by: Manu Sridharan --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 19756a7c57..11bcff71e7 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -57,7 +57,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: shellcheck - if: runner.os = 'Linux' + if: runner.os == 'Linux' - name: Report jacoco coverage uses: gradle/gradle-build-action@v2 env: From 7e5d03345c233f3b4bad91dfe1440695fd53a417 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin <52311490+armughan11@users.noreply.github.com> Date: Mon, 21 Aug 2023 22:14:11 +0530 Subject: [PATCH 09/10] Update .buildscript/check_git_clean.sh Co-authored-by: Manu Sridharan --- .buildscript/check_git_clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildscript/check_git_clean.sh b/.buildscript/check_git_clean.sh index 72dc38daa0..1ffa522f07 100755 --- a/.buildscript/check_git_clean.sh +++ b/.buildscript/check_git_clean.sh @@ -1,4 +1,4 @@ -#!/bin/sh -eu +#!/bin/sh -eux if [ -n "$(git status --porcelain)" ]; then echo 'warning: source tree contains uncommitted changes; .gitignore patterns may need to be fixed' From f33ab7049f4cd608d9ab117430e78ba3416b92b3 Mon Sep 17 00:00:00 2001 From: Md Armughanuddin Date: Mon, 21 Aug 2023 22:27:27 +0530 Subject: [PATCH 10/10] Updated Shebang to Address SC2164 --- .github/workflows/run_main_benchmarks.sh | 8 ++++---- .github/workflows/run_pr_benchmarks.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run_main_benchmarks.sh b/.github/workflows/run_main_benchmarks.sh index d96a82a41f..fad59dcd0d 100644 --- a/.github/workflows/run_main_benchmarks.sh +++ b/.github/workflows/run_main_benchmarks.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/bash -eux -cd "$BRANCH_NAME/" || exit +cd "$BRANCH_NAME/" mkdir main -cd main/ || exit +cd main/ git clone git@github.com:Uber/NullAway.git -cd NullAway/ || exit +cd NullAway/ ./gradlew jmh --no-daemon diff --git a/.github/workflows/run_pr_benchmarks.sh b/.github/workflows/run_pr_benchmarks.sh index 62dfcbb372..83c4a3b20d 100644 --- a/.github/workflows/run_pr_benchmarks.sh +++ b/.github/workflows/run_pr_benchmarks.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/bash -eux -cd "$BRANCH_NAME/" || exit +cd "$BRANCH_NAME/" mkdir pr -cd pr/ || exit +cd pr/ git clone --branch "$BRANCH_NAME" --single-branch git@github.com:"$REPO_NAME".git NullAway -cd NullAway/ || exit +cd NullAway/ ./gradlew jmh --no-daemon