Skip to content
Merged
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
57 changes: 57 additions & 0 deletions .github/workflows/validate-powerbi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Validate Power BI report

on:
pull_request:
branches: [ main ]
paths:
- '**.pbip'
- '**.tmdl'
- 'rules/**'

jobs:
validate:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Clone PBIRInspectorV2
run: git clone https://github.com/NatVanG/PBI-InspectorV2.git

- name: Build PBIRInspectorCLI
run: |
cd PBI-InspectorV2/PBIRInspectorCLI
dotnet build -c Release

- name: Run PBIRInspector validation
shell: pwsh
run: |
Write-Host "🔍 Starting PBIRInspector validation..."

$output = & .\PBI-InspectorV2\PBIRInspectorCLI\bin\Release\net8.0\PBIRInspectorCLI.exe `
-fabricitem "${{ github.workspace }}\CareTogether.Report" `
-rules "${{ github.workspace }}\rules\pbi-inspector-rules.json" `
-formats "Console,GitHub"

Write-Host "📋 PBIRInspector Output:"
Write-Host "------------------------------------------------------------"
Write-Output $output
Write-Host "------------------------------------------------------------"

# Opcional: salvar log em arquivo (para análise posterior)
$logPath = "${{ github.workspace }}\pbi-inspector-output.log"
$output | Out-File -FilePath $logPath -Encoding UTF8

# Fails build if any warning is found
if ($output -match "Warning:") {
Write-Error "❌ Validation failed due to rule violations."
exit 1
}

Write-Host "✅ No rule violations detected."
Loading
Loading