-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract bench according to wiki instructions #4627
Conversation
In CI it is common for the process to stop immediately when an error occurs. Therefore, using We could make the behavior of posix and msys2 shells consistent, this will enable a nice simplification of the break statement in the loop. diff --git a/.github/workflows/stockfish_test.yml b/.github/workflows/stockfish_test.yml
index 28218402..708875d1 100644
--- a/.github/workflows/stockfish_test.yml
+++ b/.github/workflows/stockfish_test.yml
@@ -18,38 +18,38 @@ jobs:
comp: gcc
run_32bit_tests: true
run_64bit_tests: true
- shell: bash {0}
+ shell: bash
- name: Ubuntu 20.04 Clang
os: ubuntu-20.04
compiler: clang++
comp: clang
run_32bit_tests: true
run_64bit_tests: true
- shell: bash {0}
+ shell: bash
- name: Android NDK aarch64
os: ubuntu-22.04
compiler: aarch64-linux-android21-clang++
comp: ndk
run_armv8_tests: true
- shell: bash {0}
+ shell: bash
- name: Android NDK arm
os: ubuntu-22.04
compiler: armv7a-linux-androideabi21-clang++
comp: ndk
run_armv7_tests: true
- shell: bash {0}
+ shell: bash
- name: MacOS 12 Apple Clang
os: macos-12
compiler: clang++
comp: clang
run_64bit_tests: true
- shell: bash {0}
+ shell: bash
- name: MacOS 12 GCC 11
os: macos-12
compiler: g++-11
comp: gcc
run_64bit_tests: true
- shell: bash {0}
+ shell: bash
- name: Windows 2022 Mingw-w64 GCC x86_64
os: windows-2022
compiler: g++
@@ -115,8 +115,10 @@ jobs:
- name: Extract the bench number from the commit history
run: |
- git log HEAD | grep -o "\b[Bb]ench[ :]\+[1-9][0-9]\{5,9\}\b" | head -n 1 | sed "s/[^0-9]//g" > git_sig
- [ -s git_sig ] && echo "benchref=$(cat git_sig)" >> $GITHUB_ENV && echo "Reference bench:" $(cat git_sig) || echo "No bench found"
+ for ((n=0; n<100; n++)); do
+ benchref=$(git log HEAD~$n -1 | grep -v '^[[:space:]]*$' | tail -n 1 | grep '\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b' | sed 's/[^0-9]//g') && break || true
+ done
+ [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "Reference bench: $benchref" || echo "No bench found"
- name: Check compiler
run: | |
Tested successfully the version with EDIT: PR updated replacing |
@vondele if your doubts are about the search of the bench value on the last line of the message body, we can easily search for the last line of text that contains the searched pattern, reversing the lines of the message body with benchref=$(git log HEAD~$n -1 | tac | grep -m 1 -o -x '[[:space:]]*\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b[[:space:]]*' | sed 's/[^0-9]//g') |
yes, I think that's best. |
I would remove the -x option else this works only if the bench segment is given alone in a single line. |
The CI is here to help to write the new commits according to the instruction.
By the way reading the output should help to deal with the ghosts :) git log HEAD | grep "[Bb]ench" | less EDIT: we have this nice commit wrote by a devilish person...
|
ready for review.
|
- loop through the commits starting from the latest one - read the bench value from the last match, if any, of the template in the commit body text closes #4627 No functional change
- loop through the commits starting from the latest one - read the bench value from the last match, if any, of the template in the commit body text closes official-stockfish#4627 No functional change
in the commit body text
closes #4627
No functional change