|
| 1 | +name: build-azure |
| 2 | + |
| 3 | +# Builds the Azure-native solution (Functions + HybridAgent + Web.Azure + Shared + Core) |
| 4 | +# and lints the Bicep templates. Triggered ONLY when paths relevant to the Azure |
| 5 | +# stack change. The shared Core path is intentionally listed here AND in |
| 6 | +# build-onprem.yml so a single Core change exercises BOTH stacks in parallel |
| 7 | +# (this replaces the former build-both.yml regression guard). |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: [master, main, feature/**] |
| 12 | + paths: |
| 13 | + - 'src/BitLockerKeyMonitor.Functions/**' |
| 14 | + - 'src/BitLockerKeyMonitor.HybridAgent/**' |
| 15 | + - 'src/BitLockerKeyMonitor.Web.Azure/**' |
| 16 | + - 'src/BitLockerKeyMonitor.Shared/**' |
| 17 | + - 'src/BitLockerKeyMonitor.Core/**' |
| 18 | + - 'tests/BitLockerKeyMonitor.Core.Tests/**' |
| 19 | + - 'tests/BitLockerKeyMonitor.Functions.Tests/**' |
| 20 | + - 'tests/BitLockerKeyMonitor.HybridAgent.Tests/**' |
| 21 | + - 'BitLockerKeyMonitor.Azure.slnx' |
| 22 | + - 'Directory.Build.props' |
| 23 | + - 'infra/**' |
| 24 | + - 'Deploy-Azure.ps1' |
| 25 | + - 'Deploy-HybridAgent.ps1' |
| 26 | + - '.github/workflows/build-azure.yml' |
| 27 | + pull_request: |
| 28 | + branches: [master, main] |
| 29 | + paths: |
| 30 | + - 'src/BitLockerKeyMonitor.Functions/**' |
| 31 | + - 'src/BitLockerKeyMonitor.HybridAgent/**' |
| 32 | + - 'src/BitLockerKeyMonitor.Web.Azure/**' |
| 33 | + - 'src/BitLockerKeyMonitor.Shared/**' |
| 34 | + - 'src/BitLockerKeyMonitor.Core/**' |
| 35 | + - 'tests/BitLockerKeyMonitor.Core.Tests/**' |
| 36 | + - 'tests/BitLockerKeyMonitor.Functions.Tests/**' |
| 37 | + - 'tests/BitLockerKeyMonitor.HybridAgent.Tests/**' |
| 38 | + - 'BitLockerKeyMonitor.Azure.slnx' |
| 39 | + - 'Directory.Build.props' |
| 40 | + - 'infra/**' |
| 41 | + - 'Deploy-Azure.ps1' |
| 42 | + - 'Deploy-HybridAgent.ps1' |
| 43 | + - '.github/workflows/build-azure.yml' |
| 44 | + |
| 45 | +jobs: |
| 46 | + build: |
| 47 | + runs-on: windows-latest |
| 48 | + name: Build BitLockerKeyMonitor.Azure.slnx |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v4 |
| 51 | + |
| 52 | + - name: Setup .NET 10 |
| 53 | + uses: actions/setup-dotnet@v4 |
| 54 | + with: |
| 55 | + dotnet-version: '10.0.x' |
| 56 | + |
| 57 | + - name: Restore |
| 58 | + run: dotnet restore BitLockerKeyMonitor.Azure.slnx |
| 59 | + |
| 60 | + - name: Build |
| 61 | + run: dotnet build BitLockerKeyMonitor.Azure.slnx --no-restore --nologo -v minimal -c Release |
| 62 | + |
| 63 | + - name: Test (Functions + HybridAgent) |
| 64 | + run: | |
| 65 | + dotnet test tests/BitLockerKeyMonitor.Functions.Tests/BitLockerKeyMonitor.Functions.Tests.csproj --no-build --no-restore --verbosity minimal -c Release |
| 66 | + dotnet test tests/BitLockerKeyMonitor.HybridAgent.Tests/BitLockerKeyMonitor.HybridAgent.Tests.csproj --no-build --no-restore --verbosity minimal -c Release |
| 67 | +
|
| 68 | + bicep-lint: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + name: Bicep build + lint |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + |
| 74 | + - name: Install Bicep CLI |
| 75 | + run: | |
| 76 | + curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 |
| 77 | + chmod +x ./bicep |
| 78 | + sudo mv ./bicep /usr/local/bin/bicep |
| 79 | + bicep --version |
| 80 | +
|
| 81 | + - name: Build Bicep (lint + compile) |
| 82 | + run: bicep build infra/main.bicep --outdir ./bicep-out |
0 commit comments