Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .azdignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.github/
.gitignore

infra/tests/

CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/bicep-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Bicep Validate

on:
pull_request:
paths:
- 'infra/**'
push:
branches: [main]
paths:
- 'infra/**'
workflow_dispatch:

permissions:
id-token: write
contents: read

env:
# Override with your test subscription/location
AZURE_LOCATION: eastus2

jobs:
# ─────────────────────────────────────────────
# Layer 1: Lint & Build (no Azure creds needed)
# ─────────────────────────────────────────────
lint:
name: Lint & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Bicep CLI
run: |
# Install az CLI if not present (needed for act/local testing)
if ! command -v az &> /dev/null; then
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
fi
az bicep install

- name: Lint main.bicep
run: az bicep lint --file infra/main.bicep

- name: Build main.bicep
run: az bicep build --file infra/main.bicep --stdout > /dev/null

- name: Build all modules independently
run: |
for f in infra/modules/*.bicep; do
echo "::group::Building $(basename $f)"
az bicep build --file "$f" --stdout > /dev/null
echo "::endgroup::"
done

# ─────────────────────────────────────────────
# Layer 2 & 3: Validate + What-If per scenario
# ─────────────────────────────────────────────
validate:
name: "Validate: ${{ matrix.scenario }}"
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
include:
- scenario: new-project
params: infra/tests/new-project.parameters.json
- scenario: new-project-with-model
params: infra/tests/new-project-with-model.parameters.json
- scenario: existing-project
params: infra/tests/existing-project.parameters.json
- scenario: existing-project-new-acr
params: infra/tests/existing-project-new-acr.parameters.json

steps:
- uses: actions/checkout@v4

- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Validate template
run: |
az deployment sub validate \
--location "${{ env.AZURE_LOCATION }}" \
--template-file infra/main.bicep \
--parameters @${{ matrix.params }}

- name: What-If preview
run: |
az deployment sub what-if \
--location "${{ env.AZURE_LOCATION }}" \
--template-file infra/main.bicep \
--parameters @${{ matrix.params }} \
--no-pretty-print
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,6 @@ FodyWeavers.xsd
*.msix
*.msm
*.msp

# Bicep compiled ARM templates
infra/main.json
137 changes: 0 additions & 137 deletions infra/abbreviations.json

This file was deleted.

27 changes: 0 additions & 27 deletions infra/core/ai/acr-role-assignment.bicep

This file was deleted.

Loading