Skip to content

Update main_cp-testing-ga-lin-con.yml #10

Update main_cp-testing-ga-lin-con.yml

Update main_cp-testing-ga-lin-con.yml #10

name: cp-eas-flex-system-msi
on:
push:
branches:
- main
workflow_dispatch:
permissions:
id-token: write
env:
AZURE_FUNCTIONAPP_NAME: 'cp-eas-flex-system-msi'
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.'
PYTHON_VERSION: '3.10'
jobs:
run:
name: Run E2E Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python ${{ env.PYTHON_VERSION }} Environment
uses: actions/setup-python@v1
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: E2E Resolve Project Dependencies Using Pip
shell: bash
run: |
pushd '${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
python -m pip install --upgrade pip
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
echo "$GITHUB_SHA" > sha.txt
popd
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID_FA_PYTHON310_FLEXCON }}
tenant-id: ${{ secrets.AZURE_TENANT_ID_FA_E2E_TESTS }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID_FA_E2E_TESTS }}
- name: E2E Run Azure Functions Action
uses: ./
id: fa
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
remote-build: true
- name: E2E Check HttpTrigger Result
shell: pwsh
run: |
$i = 0
while ($i -lt 10) {
sleep 10
$RESPONSE = $(curl "${{ steps.fa.outputs.app-url }}/api/HttpTrigger")
$RESULT = ($RESPONSE -eq "$env:GITHUB_SHA")
if ($RESULT) {
exit 0
}
$i = $i + 1
}
exit 1