From c9dca98403f2acfef3d3db01f6df85f2d226cb70 Mon Sep 17 00:00:00 2001 From: Balaga Gayatri Date: Mon, 23 Aug 2021 13:44:28 +0530 Subject: [PATCH] Workflow for testing automation (#131) * Create azure-login-pr-check.yml * Update azure-login-pr-check.yml * Update azure-login-pr-check.yml * Update azure-login-pr-check.yml * Update azure-login-pr-check.yml * Update azure-login-pr-check.yml * Update azure-login-pr-check.yml --- .github/workflows/azure-login-pr-check.yml | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/azure-login-pr-check.yml diff --git a/.github/workflows/azure-login-pr-check.yml b/.github/workflows/azure-login-pr-check.yml new file mode 100644 index 00000000..1a69c8e2 --- /dev/null +++ b/.github/workflows/azure-login-pr-check.yml @@ -0,0 +1,71 @@ +name: pr-check + +on: + pull_request_target: + branches: + - master + - 'releases/*' +jobs: + az-login-test: + environment: Automation test + runs-on: windows-latest + steps: + - name: Checkout from PR branch + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + + # Using 12.x version as an example + - name: Set Node.js 12.x for GitHub Action + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: installing node_modules + run: npm install + + - name: Build GitHub Action + run: npm run build + + - name: 'Az CLI login with subscription' + uses: ./ + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - run: | + az account show + # az webapp list + + - name: 'Az CLI login without subscription' + uses: ./ + with: + creds: ${{ secrets.AZURE_CREDENTIALS_NO_SUB }} + allow-no-subscriptions: true + + - run: | + az account show + + - name: 'Azure PowerShell login with subscription' + uses: ./ + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + enable-AzPSSession: true + + - uses: azure/powershell@v1 + with: + inlineScript: "Get-AzContext" + azPSVersion: "latest" + + - name: 'Azure PowerShell login without subscription' + uses: ./ + with: + creds: ${{secrets.AZURE_CREDENTIALS_NO_SUB}} + enable-AzPSSession: true + allow-no-subscriptions: true + + - uses: azure/powershell@v1 + with: + inlineScript: "Get-AzContext" + azPSVersion: "latest" + +