Skip to content

Commit 698c524

Browse files
committed
Fix Overwatch workflow for scheduled jobs
1 parent 8404b64 commit 698c524

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

.github/workflows/ogf_workflow.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
description: 'Process results and update badges or not'
1919
required: true
2020
default: 'true'
21+
cleanup:
22+
description: 'To cleanup the test resource groups'
23+
default: 'true'
2124
schedule:
2225
# Runs every 3 hours.
2326
# * is a special character in YAML so you have to quote this string
@@ -33,6 +36,8 @@ env:
3336
FAIL_COLOR: "red"
3437
PARTIAL_PASS_COLOR: "yellow"
3538
BADGE_FOLDER_NAME: "badges"
39+
DEFAULT_DEPLOYMENT_LANGUAGE: "python"
40+
DEFAULT_DEPLOYMENT_LANGUAGE_VERSION: "3.8"
3641
LANGUAGE: ${{ github.event.inputs.language }}
3742
LANGUAGE_VERSION: ${{ github.event.inputs.language_version }}
3843
OS: "Linux"
@@ -118,9 +123,9 @@ jobs:
118123
inlineScript: |
119124
az functionapp create --consumption-plan-location ${{ matrix.region }} \
120125
--name $FUNCTION_APP_NAME --os-type $OS \
121-
--functions-version 3 --runtime $LANGUAGE \
126+
--functions-version 3 --runtime ${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }} \
122127
--resource-group $RESOURCE_GROUP_NAME \
123-
--runtime-version $LANGUAGE_VERSION \
128+
--runtime-version ${{ env.LANGUAGE_VERSION || env.DEFAULT_DEPLOYMENT_LANGUAGE_VERSION }} \
124129
--storage-account $STORAGE_ACCOUNT_NAME \
125130
--tags "created on= $(date)" "Use=OGFTest"
126131
sleep 5 # Adding some breathing space for Storage Account creation.
@@ -135,8 +140,8 @@ jobs:
135140
sleep 2
136141
137142
az functionapp create --resource-group $RESOURCE_GROUP_NAME --plan $FUNCTION_APP_PLAN_NAME \
138-
--name $FUNCTION_APP_NAME --functions-version 3 --runtime $LANGUAGE \
139-
--runtime-version $LANGUAGE_VERSION --storage-account $STORAGE_ACCOUNT_NAME \
143+
--name $FUNCTION_APP_NAME --functions-version 3 --runtime ${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }} \
144+
--runtime-version ${{ env.LANGUAGE_VERSION || env.DEFAULT_DEPLOYMENT_LANGUAGE_VERSION }} --storage-account $STORAGE_ACCOUNT_NAME \
140145
--tags "created on= $(date)" "Use=OGFTest"
141146
sleep 2
142147
@@ -150,8 +155,8 @@ jobs:
150155
sleep 3
151156
152157
az functionapp create --resource-group $RESOURCE_GROUP_NAME --plan $FUNCTION_APP_PLAN_NAME \
153-
--name $FUNCTION_APP_NAME --functions-version 3 --runtime $LANGUAGE \
154-
--runtime-version $LANGUAGE_VERSION --storage-account $STORAGE_ACCOUNT_NAME \
158+
--name $FUNCTION_APP_NAME --functions-version 3 --runtime ${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }} \
159+
--runtime-version ${{ env.LANGUAGE_VERSION || env.DEFAULT_DEPLOYMENT_LANGUAGE_VERSION }} --storage-account $STORAGE_ACCOUNT_NAME \
155160
--tags "created on= $(date)" "Use=OGFTest"
156161
sleep 3
157162
@@ -168,13 +173,13 @@ jobs:
168173
cd $GITHUB_WORKSPACE
169174
git clone https://github.com/vrdmr/AzFunctionsPythonPerformance.git
170175
cd AzFunctionsPythonPerformance
171-
func init --worker-runtime $LANGUAGE
176+
func init --worker-runtime ${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }}
172177
173178
try=1
174179
is_it_deployed=1
175180
while [ $is_it_deployed -eq 1 ]; do
176181
177-
func azure functionapp publish $FUNCTION_APP_NAME --$LANGUAGE
182+
func azure functionapp publish $FUNCTION_APP_NAME --${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }}
178183
if [ $? == 0 ]; then
179184
is_it_deployed=0
180185
else
@@ -190,7 +195,7 @@ jobs:
190195
done
191196
192197
# Sometimes the code isn't deployed correctly. Attempt deploying again.
193-
func azure functionapp publish $FUNCTION_APP_NAME --$LANGUAGE
198+
func azure functionapp publish $FUNCTION_APP_NAME --${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }}
194199
o=$(func azure functionapp list-functions $FUNCTION_APP_NAME | grep Invoke || true)
195200
echo $o
196201
@@ -226,7 +231,7 @@ jobs:
226231
done
227232
228233
- name: Process test results
229-
if: ${{ github.event.inputs.process_results == 'true' }}
234+
if: ${{ github.event.inputs.process_results == '' || github.event.inputs.process_results == 'true' }}
230235
env:
231236
SKU: ${{ matrix.sku }}
232237
REGION: ${{ matrix.region }}
@@ -282,7 +287,9 @@ jobs:
282287
283288
for functionsummaryfile in $(ls -p | grep -v /); do
284289
local badge_id="$functionsummaryfile"
285-
local blob_name="$SKU$UNDER$REGION$UNDER$functionsummaryfile$UNDER$LANGUAGE$UNDER$LANGUAGE_VERSION"
290+
local LANG=${{ env.LANGUAGE || env.DEFAULT_DEPLOYMENT_LANGUAGE }}
291+
local LANG_VER=${{ env.LANGUAGE_VERSION || env.DEFAULT_DEPLOYMENT_LANGUAGE_VERSION }}
292+
local blob_name="$SKU$UNDER$REGION$UNDER$functionsummaryfile$UNDER$LANG$UNDER$LANG_VER"
286293
287294
if [ "$(node -e "const fs = require('fs'); const data = fs.readFileSync('$functionsummaryfile'); const summary = JSON.parse(data); console.log(summary.root_group.checks['status is 200'].fails)")" -eq "0" ]; then
288295
echo "$functionsummaryfile ran successfully | Generating a new badge https://img.shields.io/badge/$badge_id-$HOST_VERSION-$PASS_COLOR.svg and will save to $BADGE_FOLDER_NAME/$functionsummaryfile.svg"

0 commit comments

Comments
 (0)