-
Notifications
You must be signed in to change notification settings - Fork 39
103 lines (96 loc) · 4.37 KB
/
edge-build-ci-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: edge-build-ci-workflow
on:
push:
schedule:
- cron: '0 */3 * * *'
workflow_dispatch:
jobs:
test_action_job:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v1
- name: Installing Az CLI Edge build
run: |
cd ../..
CWD="$(pwd)"
python3 -m venv oidc-venv
. oidc-venv/bin/activate
echo "***********activated virual environment**********"
python3 -m pip install --upgrade pip
echo "***************started installing cli edge build******************"
pip3 install -q --upgrade --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --no-cache-dir --upgrade-strategy=eager
echo "***************installed cli Edge build*******************"
echo "$CWD/oidc-venv/bin" >> $GITHUB_PATH
az --version
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "16.x"
- run: npm install --production
- run: sudo npm i -g ts-node
- name: Resource group scope test
env:
INPUT_SCOPE: resourcegroup
INPUT_SUBSCRIPTIONID: ${{ secrets.SUBSCRIPTION_ID }}
INPUT_RESOURCEGROUPNAME: E2eTestResourceGroupForArmAction
INPUT_TEMPLATE: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/webapp-basic-linux/azuredeploy.json
INPUT_PARAMETERS: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/webapp-basic-linux/azuredeploy.parameters.json
INPUT_DEPLOYMENTNAME: github-test-eb-rg
INPUT_DEPLOYMENTMODE: Complete
EXPECTED_TO: pass
run: ts-node test/main.tests.ts
- name: Resource group scope test - Negative
env:
INPUT_SCOPE: resourcegroup
INPUT_SUBSCRIPTIONID: ${{ secrets.SUBSCRIPTION_ID }}
INPUT_RESOURCEGROUPNAME: E2eTestResourceGroupForArmAction
INPUT_TEMPLATE: ./test/resourceGroup-Negative/template.json
INPUT_PARAMETERS: ./test/resourceGroup-Negative/parameters.json
INPUT_REGION: eastasia
INPUT_DEPLOYMENTNAME: github-test-eb-rg
INPUT_DEPLOYMENTMODE: Complete
EXPECTED_TO: fail
run: ts-node test/main.tests.ts
- name: Subscription scope test
env:
INPUT_SCOPE: subscription
INPUT_SUBSCRIPTIONID: ${{ secrets.SUBSCRIPTION_ID }}
INPUT_REGION: centralus
INPUT_TEMPLATE: https://raw.githubusercontent.com/Azure/azure-docs-json-samples/master/azure-resource-manager/emptyrg.json
INPUT_PARAMETERS: rgName=demoResourceGroup rgLocation=centralus
INPUT_DEPLOYMENTNAME: github-test-eb-subs
EXPECTED_TO: pass
run: ts-node test/main.tests.ts
- name: Subscription scope test - Negative
env:
INPUT_SCOPE: subscription
INPUT_SUBSCRIPTIONID: ${{ secrets.SUBSCRIPTION_ID }}
INPUT_REGION: centralus
INPUT_TEMPLATE: ./test/subscription-Negative/template.json
INPUT_PARAMETERS: rgName=demoResourceGroup rgLocation=centralus
INPUT_DEPLOYMENTNAME: github-test-eb-subs
EXPECTED_TO: fail
run: ts-node test/main.tests.ts
- name: Validate mode test
env:
INPUT_SCOPE: resourcegroup
INPUT_SUBSCRIPTIONID: ${{ secrets.SUBSCRIPTION_ID }}
INPUT_RESOURCEGROUPNAME: E2eTestResourceGroupForArmAction
INPUT_TEMPLATE: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/webapp-basic-linux/azuredeploy.json
INPUT_PARAMETERS: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/webapp-basic-linux/azuredeploy.parameters.json
INPUT_DEPLOYMENTNAME: github-test-eb-rg
INPUT_DEPLOYMENTMODE: Validate
EXPECTED_TO: pass
run: ts-node test/main.tests.ts
- name: Post to slack on failure
if: failure()
uses: 8398a7/[email protected]
with:
status: ${{ job.status }}
fields: repo,message,author,action,ref,workflow
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}