Skip to content

Commit 33ca92c

Browse files
parallelize by alphabet letter
1 parent 3dc2985 commit 33ca92c

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/workflows/verify.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,17 @@ export repo_dir=$(realpath $(dirname "${BASH_SOURCE[0]}")/../../)
33
pushd "${repo_dir}/clients"
44

55
# Variants are based on the generator version
6-
variant="$1"
6+
starting_letter="$1"
77

88
# find all generated clients' pom.xml
99
find . -wholename "*${variant}/pom.xml" -not -path '*/target/*' > pom_list
10+
cat pom_list_raw
11+
12+
# trim down to those starting with "${starting_letter}"
13+
cat pom_list | grep "google-api-services-${starting_letter}" > pom_list
1014
cat pom_list
1115

16+
1217
# format result to list of Maven modules
1318
cat pom_list | cut -d'/' -f2-4 \
1419
| sed 's/\(.*\)/<module>\1<\/module>/' > module_list
@@ -20,9 +25,11 @@ cat pom.xml
2025

2126
# test compilation
2227
mvn clean compile -T 1.5C -Dmaven.testSkip=true -Denforcer.skip -fae --fail-at-end 2>&1 | tee out
23-
cat out | grep -E "^\[ERROR\] Failed to execute goal" > errors
28+
cat out | grep 'rev20' | grep 's]' | grep 'FAILURE' > errors
2429
if [[ $(cat errors | wc -l) -gt 0 ]]; then
25-
echo "Compilation errors found"
26-
exit 1
30+
echo "Compilation errors found in the following libraries:"
31+
cat errors
32+
# send to GH output
33+
echo "failed_libraries=$(cat errors | tr '\n' ',')" > "${GITHUB_OUTPUT}"
2734
fi
2835
echo "No compilation errors found"

.github/workflows/verify.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ jobs:
1313
runs-on: 'ubuntu-24.04'
1414
strategy:
1515
matrix:
16-
variant: [ 1.26.0, 1.27.0, 1.28.0, 1.29.2, 1.30.1, 1.31.0, 2.0.0 ]
17-
fail-fast: false
16+
# We will parallelize by alphabet letter
17+
ascii_code: ${{ range(97, 102) }}
18+
fail-fast: false
19+
outputs:
20+
failed_libraries:
1821
steps:
1922
- uses: actions/setup-java@v3
2023
with:
@@ -26,5 +29,13 @@ jobs:
2629

2730
- working-directory: google-api-java-client-services
2831
run: |
29-
bash .github/workflows/verify.sh ${{ matrix.variant }}
32+
set -ex
33+
bash .github/workflows/verify.sh "$(printf "\x$(printf %x ${{ matrix.ascii_code }})")"
34+
print_results:
35+
needs: [verify]
36+
steps:
37+
- run: |
38+
set -ex
39+
echo '${{ toJSON(needs.verify.failed_libraries) }}'
40+
3041

0 commit comments

Comments
 (0)