-
Notifications
You must be signed in to change notification settings - Fork 86
[CI] Fix ref_llvm and ref_translator in on-push-verification-in-tree task #603
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -35,9 +35,23 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||
| - name: Checkout opencl-clang sources for action files | ||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| # This step will fail when the branch naming scheme 'ocl-open-XXX' changes! | ||||||||||||||||||||||||||||||||||||||||||||
| - name: Parse LLVM version from branch name | ||||||||||||||||||||||||||||||||||||||||||||
| id: check-llvm-version | ||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||
| BRANCH="${{ github.base_ref }}" # on: pull_request, otherwise null | ||||||||||||||||||||||||||||||||||||||||||||
| BRANCH=${BRANCH:-${{ github.ref_name }}} # on: push | ||||||||||||||||||||||||||||||||||||||||||||
| LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19 | ||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "$LLVM_VERSION_LONG" ]; then | ||||||||||||||||||||||||||||||||||||||||||||
| echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" | ||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||
| LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 | ||||||||||||||||||||||||||||||||||||||||||||
| echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| LLVM_VERSION_LONG=$(echo $BRANCH | grep -oP 'ocl-open-\K\d+') # Eg. 190 for LLVM 19 | |
| if [ -z "$LLVM_VERSION_LONG" ]; then | |
| echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" | |
| exit 1 | |
| fi | |
| LLVM_VERSION_SHORT=${LLVM_VERSION_LONG::-1} # Eg. 19 for LLVM 19 | |
| echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT | |
| # Extract the padded LLVM version (e.g., 190 for LLVM 19, 90 for LLVM 9, 200 for LLVM 20) | |
| LLVM_VERSION_PADDED=$(echo "$BRANCH" | grep -oP 'ocl-open-\K\d+') | |
| if [ -z "$LLVM_VERSION_PADDED" ]; then | |
| echo "[OPENCL-CLANG] Error: Could not parse LLVM version from branch name '$BRANCH'" | |
| exit 1 | |
| fi | |
| # Extract the actual LLVM version (e.g., 19 from 190, 9 from 90, 20 from 200) | |
| if [[ "$LLVM_VERSION_PADDED" =~ ^([0-9]+)0$ ]]; then | |
| LLVM_VERSION_SHORT="${BASH_REMATCH[1]}" | |
| else | |
| echo "[OPENCL-CLANG] Error: Unexpected LLVM version format '$LLVM_VERSION_PADDED' from branch name '$BRANCH'" | |
| exit 1 | |
| fi | |
| echo "llvm_version=$LLVM_VERSION_SHORT" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states 'Eg. 190 for LLVM 19' but the grep pattern
\K\d+would match '190' from 'ocl-open-190', not just '19'. The example should clarify this matches the full numeric suffix (e.g., '190' from 'ocl-open-190').