-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into spring-mockito
- Loading branch information
Showing
93 changed files
with
3,457 additions
and
841 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
codecov: | ||
# Disable report age checking since hits in the build cache can lead to an old timestamp | ||
max_report_age: off | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to run commands on a Google Cloud instance via SSH | ||
|
||
# Define the variables for Google Cloud project, zone, username, and instance | ||
PROJECT_ID="ucr-ursa-major-sridharan-lab" | ||
ZONE="us-central1-a" | ||
USER="root" | ||
INSTANCE="nullway-jmh" | ||
|
||
gcloud compute ssh --project=$PROJECT_ID --zone=$ZONE $USER@$INSTANCE --command="$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# This script retrieves the repository and branch details of a GitHub pull request | ||
|
||
# Assign command line arguments to variables | ||
# GH_TOKEN is the GitHub authentication token | ||
# PR_NUMBER is the number of the pull request | ||
# REPO_NAME is the name of the repository | ||
GH_TOKEN="$1" | ||
PR_NUMBER="$2" | ||
REPO_NAME="$3" | ||
|
||
PR_DETAILS=$(curl -s -H "Authorization: token $GH_TOKEN" "https://api.github.com/repos/$REPO_NAME/pulls/$PR_NUMBER") | ||
|
||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# This GitHub Actions workflow runs JMH benchmarks when a new comment is created on a pull request | ||
name: Run JMH Benchmarks for Pull Request | ||
|
||
on: | ||
issue_comment: # This workflow triggers when a comment is created | ||
types: [created] | ||
|
||
# Only allow one instance of JMH benchmarking to be running at any given time | ||
concurrency: all | ||
|
||
jobs: | ||
benchmarking: | ||
# Only run this job if a comment on a pull request contains '/benchmark' and is a PR on the uber/NullAway repository | ||
if: github.event.issue.pull_request && contains(github.event.comment.body, '/benchmark') && github.repository == 'uber/NullAway' | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Add reaction | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: '+1' | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set branch name | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
chmod +x ./.github/workflows/get_repo_details.sh | ||
./.github/workflows/get_repo_details.sh "${{ secrets.GITHUB_TOKEN }}" "${{ github.event.issue.number }}" "${{ github.repository }}" | ||
- id: 'auth' | ||
name: Authenticating | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GCP_SA_KEY_1 }}' | ||
|
||
- name: Set up Google Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
|
||
- name: Start VM | ||
run: gcloud compute instances start nullway-jmh --zone=us-central1-a | ||
|
||
- name: Run benchmarks | ||
run: | | ||
chmod +x ./.github/workflows/run_gcp_benchmarks.sh | ||
./.github/workflows/run_gcp_benchmarks.sh | ||
- name: Cleanup | ||
# Delete the branch directory on the Google Cloud instance | ||
if: always() | ||
run: | | ||
./.github/workflows/gcloud_ssh.sh " export BRANCH_NAME=${BRANCH_NAME} && rm -r -f $BRANCH_NAME" | ||
- name: Formatting Benchmark # Create a text file containing the benchmark results | ||
run: | | ||
(echo 'Main Branch:'; echo '```' ; cat main_text.txt; echo '```'; echo 'With This PR:'; echo '```' ; cat pr_text.txt; echo '```') > benchmark.txt | ||
- name: Comment Benchmark | ||
uses: mshick/add-pr-comment@v2 | ||
if: always() # This step is for adding the comment | ||
with: | ||
message-path: benchmark.txt # The path to the message file to leave as a comment | ||
message-id: benchmark | ||
- name: Stop VM | ||
if: always() | ||
run: gcloud compute instances stop nullway-jmh --zone=us-central1-a | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# This script is responsible for running benchmarks for a GitHub pull request and the main branch on Google Cloud Compute Engine (GCCE). | ||
|
||
|
||
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 | ||
|
||
# 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 | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -eux | ||
|
||
cd "$BRANCH_NAME/" | ||
mkdir main | ||
cd main/ | ||
git clone [email protected]:Uber/NullAway.git | ||
cd NullAway/ | ||
|
||
./gradlew jmh --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -eux | ||
|
||
cd "$BRANCH_NAME/" | ||
mkdir pr | ||
cd pr/ | ||
git clone --branch "$BRANCH_NAME" --single-branch [email protected]:"$REPO_NAME".git NullAway | ||
cd NullAway/ | ||
|
||
./gradlew jmh --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.