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