Skip to content

Commit 19ab469

Browse files
committed
back to this
1 parent d694a3f commit 19ab469

File tree

1 file changed

+48
-7
lines changed

1 file changed

+48
-7
lines changed

.github/workflows/azure-dev.yml

Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,44 @@ on:
77
- feature/azd-semantickernel
88
- gpickett-patch-6
99
workflow_dispatch:
10-
1110
permissions:
1211
contents: read
1312
id-token: write
1413
pull-requests: write
15-
1614
jobs:
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
2849
uses: microsoft/[email protected]
2950
id: validation
@@ -34,8 +55,28 @@ jobs:
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

Comments
 (0)