diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 7a38ca0cd10..8df8ea34f49 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -54,7 +54,7 @@ jobs: BENCHER_ADAPTER: json run: | set -euxo pipefail - docker run --name k-posting-profiling-tests-${GITHUB_SHA} \ + docker run --name k-posting-profiling-tests-${GITHUB_SHA} \ --rm -it --detach \ -e BENCHER_API_TOKEN=$BENCHER_API_TOKEN \ -e BENCHER_PROJECT=$BENCHER_PROJECT \ @@ -66,7 +66,9 @@ jobs: -e GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME \ -e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ -e GITHUB_REF=$GITHUB_REF \ + -e GITHUB_SHA=${GITHUB_SHA} \ --workdir /opt/workspace \ + -v "${workspace}:/opt/workspace" \ ${BASE_OS}:${BASE_DISTRO} - name: 'Copy K Framework' run: | @@ -81,8 +83,7 @@ jobs: - name: 'Getting Performance Tests Results' run: | set -euxo pipefail - docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c 'git config --global --add safe.directory /opt/workspace' - docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c 'python3 k-distribution/tests/profiling/post_results_to_develop.py' + docker exec -t k-posting-profiling-tests-${GITHUB_SHA} /bin/bash -c './k-distribution/tests/profiling/post_results_to_develop.py ${GITHUB_SHA}' - name: 'Posting Performance Tests Results' run: | set -euxo pipefail diff --git a/k-distribution/tests/profiling/post_results_to_develop.py b/k-distribution/tests/profiling/post_results_to_develop.py index f019a32d81e..21716a86ba9 100755 --- a/k-distribution/tests/profiling/post_results_to_develop.py +++ b/k-distribution/tests/profiling/post_results_to_develop.py @@ -1,8 +1,9 @@ #!/usr/bin/env python3 import json +import sys import subprocess -COMMIT_SHA='' +COMMIT_SHA = sys.argv[1] FROM_BRANCH='' TO_BRANCH='develop' @@ -24,10 +25,6 @@ def execute_command(command): return result.stdout -# git command to get the last commit in develop -commit_command = [ 'git', 'log', '--format=\"%H\"', '-n', '1' ] -COMMIT_SHA = execute_command(commit_command).strip('\"').strip('\"\n') - # curl command to get the branch name of last commit in develop API_URL = 'https://api.github.com/repos/runtimeverification/k/commits/' \ + COMMIT_SHA + '/pulls'