Skip to content

Commit 6b77a95

Browse files
laurenyuknakad
authored andcommitted
infra: properly fail build if has-matching-changes fails (#89)
1 parent 18d9f7c commit 6b77a95

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

buildspec.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ phases:
4545
# build images
4646
- python3 scripts/build_all.py --version $FRAMEWORK_FULL_VERSION --eia-version $EI_FRAMEWORK_VERSION --account $ACCOUNT --repo $ECR_REPO
4747

48+
- HAS_MATCHING_CHANGES_OUTPUT=$(has-matching-changes "test/" "tests/" "src/*.py" "setup.py" "setup.cfg" "docker/*" "buildspec.yml")
49+
4850
# run cpu local integration tests
4951
- |
50-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
52+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
5153
IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --py-version 2,3 --processor cpu --framework-version $FRAMEWORK_FULL_VERSION --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO
5254
else
5355
echo "skipping cpu integration tests"
@@ -62,7 +64,7 @@ phases:
6264

6365
# run gpu local integration tests
6466
- |
65-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
67+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
6668
printf "$SETUP_CMDS" > $SETUP_FILE
6769
ecr_image="$ACCOUNT.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$ECR_REPO"
6870
cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --processor gpu --py-version 2,3 --framework-version $FRAMEWORK_FULL_VERSION --region $AWS_DEFAULT_REGION --docker-base-name $ecr_image"
@@ -73,15 +75,15 @@ phases:
7375
7476
# run sagemaker integration tests
7577
- |
76-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
78+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
7779
IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker -n 16 --py-version 2,3 --processor cpu,gpu --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_FULL_VERSION --reruns 3 --reruns-delay 5
7880
else
7981
echo "skipping sagemaker integration tests"
8082
fi
8183
8284
# run eia tests
8385
- |
84-
if has-matching-changes "test/" "tests/" "src/*.py" "docker/*" "buildspec.yml"; then
86+
if [ "$HAS_MATCHING_CHANGES" = "Changes Found" ] ; then
8587
IGNORE_COVERAGE=- tox -e py36 -- test/integration/sagemaker/test_elastic_inference.py -n 2 --py-version 2,3 --processor cpu --accelerator-type $EI_ACCELERATOR_TYPE --region $AWS_DEFAULT_REGION --docker-base-name "$ECR_REPO-eia" --aws-id $ACCOUNT --framework-version $EI_FRAMEWORK_VERSION
8688
else
8789
echo "skipping sagemaker eia tests"

0 commit comments

Comments
 (0)