CI #6284
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 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 | |
- 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-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-rg | |
INPUT_DEPLOYMENTMODE: Complete | |
EXPECTED_TO: fail | |
run: ts-node test/main.tests.ts | |
# - name: Management group scope test | |
# env: | |
# INPUT_SCOPE: managementgroup | |
# INPUT_MANAGEMENTGROUPID: E2eTestGroupForArmAction | |
# INPUT_REGION: WestUS | |
# INPUT_TEMPLATE: ./test/template.json | |
# INPUT_PARAMETERS: ./test/parameters.json | |
# INPUT_DEPLOYMENTNAME: github-test-mg | |
# EXPECTED_TO: pass | |
# 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-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-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-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 }} |