@@ -2,9 +2,7 @@ name: Azure Template Validation
22on :
33 push :
44 branches :
5- - dev
65 - main
7- - feature/azd-semantickernel
86 workflow_dispatch :
97
108permissions :
@@ -15,69 +13,19 @@ permissions:
1513jobs :
1614 template_validation_job :
1715 runs-on : ubuntu-latest
18- name : Template validation
16+ name : template validation
1917 steps :
20- # Step 1: Checkout the code from your repository
21- - name : Checkout code
22- uses : actions/checkout@v4
18+ - uses : actions/checkout@v4
2319
24- # Step 2: Set up Python
25- - name : Set up Python
26- uses : actions/setup-python@v4
27- with :
28- python-version : " 3.9"
29-
30- # Step 3: Create and populate the virtual environment
31- - name : Create virtual environment and install dependencies
32- run : |
33- python -m venv .venv
34- source .venv/bin/activate
35- python -m pip install --upgrade pip
36- pip install azure-mgmt-resource azure-identity azure-core azure-mgmt-subscription azure-cli-core
37- # Install any other dependencies that might be needed
38- pip freeze > requirements-installed.txt
39- echo "Virtual environment created with these packages:"
40- cat requirements-installed.txt
41-
42- # Step 4: Create azd directory if it doesn't exist
43- - name : Create azd directory
44- run : |
45- mkdir -p ./.azd || true
46- touch ./.azd/.env || true
47-
48- # Step 5: Validate the Azure template
49- - name : Validate Azure Template
50- uses : microsoft/template-validation-action@v0.3.5
20+ - uses : microsoft/template-validation-action@Latest
5121 id : validation
5222 env :
53- AZURE_CLIENT_ID : ${{ secrets .AZURE_CLIENT_ID }}
54- AZURE_TENANT_ID : ${{ secrets .AZURE_TENANT_ID }}
55- AZURE_SUBSCRIPTION_ID : ${{ secrets .AZURE_SUBSCRIPTION_ID }}
56- AZURE_ENV_NAME : ${{ secrets .AZURE_ENV_NAME }}
57- AZURE_LOCATION : ${{ secrets .AZURE_LOCATION }}
23+ AZURE_CLIENT_ID : ${{ vars .AZURE_CLIENT_ID }}
24+ AZURE_TENANT_ID : ${{ vars .AZURE_TENANT_ID }}
25+ AZURE_SUBSCRIPTION_ID : ${{ vars .AZURE_SUBSCRIPTION_ID }}
26+ AZURE_ENV_NAME : ${{ vars .AZURE_ENV_NAME }}
27+ AZURE_LOCATION : ${{ vars .AZURE_LOCATION }}
5828 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5929
60- # Step 6: Debug output in case of failure
61- - name : Debug on failure
62- if : failure()
63- run : |
64- echo "Validation failed. Checking environment:"
65- ls -la
66- if [ -d ".venv" ]; then
67- echo ".venv directory exists"
68- ls -la .venv/bin/
69- else
70- echo ".venv directory does not exist"
71- fi
72- if [ -d "tva_*" ]; then
73- echo "TVA directory exists:"
74- find . -name "tva_*" -type d
75- ls -la $(find . -name "tva_*" -type d)
76- else
77- echo "No TVA directory found"
78- fi
79-
80- # Step 7: Print the result of the validation
81- - name : Print result
82- if : success()
30+ - name : print result
8331 run : cat ${{ steps.validation.outputs.resultFile }}
0 commit comments