Skip to content

Commit

Permalink
Using COMMIT_SHA as argument to avoid using git command inside container
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Sep 21, 2023
1 parent 0231722 commit e405d8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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: |
Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions k-distribution/tests/profiling/post_results_to_develop.py
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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'
Expand Down

0 comments on commit e405d8a

Please sign in to comment.