@@ -40,21 +40,34 @@ jobs:
4040 --var GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }} \
4141 --output text -H --dryrun
4242
43+ - name : initial check for instances using stackql-assert
44+ id : check_instances_initial
45+ uses : stackql/stackql-assert@v2.2.3
46+ with :
47+ test_query_file_path : ' ./stackql/scripts/check-instances/check-instances.iql'
48+ data_file_path : ' ./stackql/data/vars.jsonnet'
49+ vars : GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}
50+ expected_rows : 4
51+ continue-on-error : true
52+
4353 - name : deploy instances using stackql-exec
54+ if : steps.check_instances_initial.outcome == 'failure' # Run if the initial check failed
55+ id : deploy_instances
4456 uses : stackql/stackql-exec@v2.2.3
4557 with :
4658 query_file_path : ' ./stackql/scripts/deploy-instances/deploy-instances.iql'
4759 data_file_path : ' ./stackql/data/vars.jsonnet'
4860 vars : GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}
4961
5062 - name : check if we have 4 instances using stackql-assert
63+ if : steps.check_instances_initial.outcome == 'failure' && steps.deploy_instances.outcome == 'success'
5164 uses : stackql/stackql-assert@v2.2.3
5265 with :
5366 test_query_file_path : ' ./stackql/scripts/check-instances/check-instances.iql'
5467 data_file_path : ' ./stackql/data/vars.jsonnet'
55- vars : GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}
68+ vars : GOOGLE_PROJECT=${{ env.GOOGLE_PROJECT }},GOOGLE_ZONE=${{ env.GOOGLE_ZONE }}
5669 expected_rows : 4
57-
70+
5871 - name : stop running instances using stackql-exec
5972 uses : stackql/stackql-exec@v2.2.3
6073 with :
0 commit comments