Skip to content

Add files via upload #88

Add files via upload

Add files via upload #88

Workflow file for this run

name: Run JMH Benchmarks for Pull Request
on:
issue_comment:
types: [created]
jobs:
setup:
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: Checkout repository
uses: actions/checkout@v3
- name: Set branch name
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=${{ github.event.issue.number }}
PR_DETAILS=$(curl -s -H "Authorization: token $GH_TOKEN" "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER")
REPO_NAME=$(echo "$PR_DETAILS" | jq -r .head.repo.full_name)
BRANCH_NAME=$(echo "$PR_DETAILS" | jq -r .head.ref)
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- id: 'auth'
name: Authenticating
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Run benchmarks
run: |
chmod +x ./.github/workflows/run_gcp_benchmarks.sh
./.github/workflows/run_gcp_benchmarks.sh
- name: Formatting Benchmark
run: |
(echo 'Main Benchmark:'; echo '```' ; cat main_text.txt; echo '```'; echo 'PR Benchmark:'; echo '```' ; cat pr_text.txt; echo '```') > benchmark.txt
- name: Comment Benchmark
uses: mshick/add-pr-comment@v2
if: always()
with:
message-path: benchmark.txt
message-id: benchmark
- name: Cleanup
run: |
./.github/workflows/gcloud_ssh.sh " rm -r -f $BRANCH_NAME"