Skip to content

Commit

Permalink
Merge pull request #35056 from gsmet/fix-vt-ci
Browse files Browse the repository at this point in the history
Use grep and not ggrep in filter-virtual-threads-tests-json.sh
  • Loading branch information
cescoffier authored Jul 28, 2023
2 parents 335085b + 5aeef32 commit 642cd71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/filter-virtual-threads-tests-json.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXPR='((?:(?<=^)|(?<=,)|(?<=, ))('
while read -r impacted
do
EXPR+="${impacted}|"
done < <(echo -n "$1" | ggrep -Po '(?<=integration-tests/virtual-threads/).+')
done < <(echo -n "$1" | grep -Po '(?<=integration-tests/virtual-threads/).+')
EXPR+=')(,|$))+'

# Step 2: apply the filter expression via grep to each "test-modules" list and replace each original list with the filtered one
Expand All @@ -35,7 +35,7 @@ do
# Notes:
# - trailing "|" (after EXPR) avoids grep return code > 0 if nothing matches (which is a valid case)
# - "paste" joins all matches to get a single line
FILTERED=$(echo -n "${modules}" | ggrep -Po "${EXPR}|" | paste -sd " " -)
FILTERED=$(echo -n "${modules}" | grep -Po "${EXPR}|" | paste -sd " " -)
JSON=$(echo -n "${JSON}" | sed "s|${modules}|${FILTERED}|")
done < <(echo -n "${JSON}" | jq -r '.include[] | ."test-modules"')

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
outputs:
native_matrix: ${{ steps.calc-native-matrix.outputs.matrix }}
jvm_matrix: ${{ steps.calc-jvm-matrix.outputs.matrix }}
virtual_threads_matrix: ${{ steps.calc-virtual_threads-matrix.outputs.matrix }}
virtual_threads_matrix: ${{ steps.calc-virtual-threads-matrix.outputs.matrix }}
run_jvm: ${{ steps.calc-run-flags.outputs.run_jvm }}
run_devtools: ${{ steps.calc-run-flags.outputs.run_devtools }}
run_gradle: ${{ steps.calc-run-flags.outputs.run_gradle }}
Expand All @@ -228,7 +228,7 @@ jobs:
echo "${json}"
echo "matrix=${json}" >> $GITHUB_OUTPUT
- name: Calculate matrix from virtual-threads-tests.json
id: calc-virtual_threads-matrix
id: calc-virtual-threads-matrix
run: |
echo "GIB_IMPACTED_MODULES: ${GIB_IMPACTED_MODULES}"
json=$(.github/filter-virtual-threads-tests-json.sh "${GIB_IMPACTED_MODULES}" | tr -d '\n')
Expand Down

0 comments on commit 642cd71

Please sign in to comment.