Skip to content

Commit be8857f

Browse files
committed
chore: Update script to check for existance of the dependency file
1 parent 68d88ce commit be8857f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.github/scripts/test_dependency_compatibility.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@
99
# The upper-bound dependencies file will be in the format of:
1010
# ${dependency.name}=${dependency.version}
1111

12+
set -ex
13+
1214
# Check if a filename was provided as an argument
1315
if [ -z "$1" ]; then
1416
echo "Usage: $0 <dependency_file>"
1517
exit 1
1618
fi
1719

18-
DEPENDENCY_FILE="$1"
20+
UPPER_BOUND_DEPENDENCY_FILE="$1"
21+
22+
if [ ! -e "${UPPER_BOUND_DEPENDENCY_FILE}" ]; then
23+
echo "The inputted upper-bound dependency file '$FILE' does not exist"
24+
exit 1
25+
fi
26+
1927
MAVEN_COMMAND="mvn verify -Penable-integration-tests -Dclirr.skip -Dcheckstyle.skip -Dfmt.skip "
2028

2129
# Read the file line by line
@@ -33,7 +41,7 @@ while IFS= read -r line; do
3341

3442
# Append the formatted property to the Maven command
3543
MAVEN_COMMAND+=" -D${dependency.version}=${version}"
36-
done < "${DEPENDENCY_FILE}"
44+
done < "${UPPER_BOUND_DEPENDENCY_FILE}"
3745

3846
# Run the generated maven command to test with the dependency versions
3947
$MAVEN_COMMAND

.github/workflows/dependency_compatibility_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ jobs:
4444
cd -
4545
# Run for the Showcase tests
4646
- name: Perform Dependency Compatibility Testing (Showcase)
47-
run: ../.github/scripts/test_dependency_compatibility.sh dependencies.txt
47+
run: ../.github/scripts/test_dependency_compatibility.sh ../dependencies.txt
4848
working-directory: java-showcase

0 commit comments

Comments
 (0)