@@ -20,19 +20,31 @@ jobs:
2020 - name : Checkout code
2121 uses : actions/checkout@v4
2222
23- # Step 2: Set up Python environment
23+ # Step 2: Set up Python
2424 - name : Set up Python
2525 uses : actions/setup-python@v4
2626 with :
2727 python-version : ' 3.9'
28-
29- # Step 3: Install required Python packages
30- - name : Install dependencies
28+
29+ # Step 3: Create and populate the virtual environment
30+ - name : Create virtual environment and install dependencies
3131 run : |
32+ python -m venv .venv
33+ source .venv/bin/activate
3234 python -m pip install --upgrade pip
33- pip install azure-mgmt-resource azure-identity azure-core
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
3446
35- # Step 4 : Validate the Azure template using microsoft/template-validation-action
47+ # Step 5 : Validate the Azure template
3648 - name : Validate Azure Template
37493850 id : validation
4456 AZURE_LOCATION : ${{ secrets.AZURE_LOCATION }}
4557 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4658
47- # Step 5: Print the result of the validation
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
78+
79+ # Step 7: Print the result of the validation
4880 - name : Print result
81+ if : success()
4982 run : cat ${{ steps.validation.outputs.resultFile }}
0 commit comments