77 - feature/azd-semantickernel
88 - gpickett-patch-6
99 workflow_dispatch :
10+
1011permissions :
1112 contents : read
1213 id-token : write
1314 pull-requests : write
15+
1416jobs :
1517 template_validation_job :
1618 runs-on : ubuntu-latest
1719 name : Template validation
20+
1821 steps :
1922 # Step 1: Checkout the code from your repository
2023 - name : Checkout code
2124 uses : actions/checkout@v4
2225
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
26+ # Step 2: Validate the Azure template using microsoft/template-validation-action
4827 - name : Validate Azure Template
49285029 id : validation
5534 AZURE_ENV_NAME : ${{ secrets.AZURE_ENV_NAME }}
5635 AZURE_LOCATION : ${{ secrets.AZURE_LOCATION }}
5736 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
7837
79- # Step 7: Print the result of the validation
38+
39+ # Step 3: Print the result of the validation
8040 - name : Print result
81- if : success()
82- run : cat ${{ steps.validation.outputs.resultFile }}
41+ run : cat ${{ steps.validation.outputs.resultFile }}
0 commit comments