66 - main
77 - feature/azd-semantickernel
88 workflow_dispatch :
9-
109permissions :
1110 contents : read
1211 id-token : write
1312 pull-requests : write
14-
1513jobs :
1614 template_validation_job :
1715 runs-on : ubuntu-latest
1816 name : Template validation
19-
2017 steps :
2118 # Step 1: Checkout the code from your repository
2219 - name : Checkout code
2320 uses : actions/checkout@v4
2421
25- # Step 2: Validate the Azure template using microsoft/template-validation-action
22+ # Step 2: Set up Python
23+ - name : Set up Python
24+ uses : actions/setup-python@v4
25+ with :
26+ python-version : ' 3.9'
27+
28+ # Step 3: Create and populate the virtual environment
29+ - name : Create virtual environment and install dependencies
30+ run : |
31+ python -m venv .venv
32+ source .venv/bin/activate
33+ python -m pip install --upgrade pip
34+ pip install azure-mgmt-resource azure-identity azure-core azure-mgmt-subscription azure-cli-core
35+ # Install any other dependencies that might be needed
36+ pip freeze > requirements-installed.txt
37+ echo "Virtual environment created with these packages:"
38+ cat requirements-installed.txt
39+
40+ # Step 4: Create azd directory if it doesn't exist
41+ - name : Create azd directory
42+ run : |
43+ mkdir -p ./.azd || true
44+ touch ./.azd/.env || true
45+
46+ # Step 5: Validate the Azure template
2647 - name : Validate Azure Template
27482849 id : validation
3354 AZURE_ENV_NAME : ${{ secrets.AZURE_ENV_NAME }}
3455 AZURE_LOCATION : ${{ secrets.AZURE_LOCATION }}
3556 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57+
58+ # Step 6: Debug output in case of failure
59+ - name : Debug on failure
60+ if : failure()
61+ run : |
62+ echo "Validation failed. Checking environment:"
63+ ls -la
64+ if [ -d ".venv" ]; then
65+ echo ".venv directory exists"
66+ ls -la .venv/bin/
67+ else
68+ echo ".venv directory does not exist"
69+ fi
70+ if [ -d "tva_*" ]; then
71+ echo "TVA directory exists:"
72+ find . -name "tva_*" -type d
73+ ls -la $(find . -name "tva_*" -type d)
74+ else
75+ echo "No TVA directory found"
76+ fi
3677
37-
38- # Step 3: Print the result of the validation
78+ # Step 7: Print the result of the validation
3979 - name : Print result
80+ if : success()
4081 run : cat ${{ steps.validation.outputs.resultFile }}
0 commit comments