08. Reports, CI & Build Check
← Previous: Runtime Components | Next: Profiles & Settings →
Exporting Reports
From the Scene Doctor ⋯ menu, you can export detailed audit data at any time:
- Export Report (JSON + HTML): Audits all currently opened scenes and exports the results immediately.
- Audit Build Scenes…: Opens each scene enabled in Unity’s Build Settings sequentially, audits it against the platform profile, exports comprehensive multi-scene telemetry, and restores your previous open scenes cleanly.
Reports are saved to timestamped directories under the project root:
FuzzyOptimizerReports/yyyyMMdd_HHmmss/├── report.json # Full machine-readable audit data (scores, metrics, rule IDs, issue counts)└── report.html # Standalone, self-contained HTML visual dashboard (zero external CSS/JS dependencies)Headless CLI for CI / CD Pipelines
Run automated audits in continuous integration environments (GitHub Actions, GitLab CI, Jenkins) using Unity’s -executeMethod flag:
Unity -batchmode -nographics -projectPath . \ -executeMethod FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports.FuzzyOptimizerCLI.Audit \ -fuzzyProfile Mobile \ -fuzzyScenes build \ -fuzzyMinScore 75 \ -fuzzyFailOnCritical \ -fuzzyOutput Reports/ \ -logFile -Command Line Arguments
| Argument | Valid Values | Default | Description |
|---|---|---|---|
-fuzzyProfile | Mobile, StandaloneVR, DesktopMid, DesktopHigh, Custom | DesktopMid | Platform budget profile. Custom uses the profile asset assigned in project settings. |
-fuzzyProfileAsset | Asset path string | — | Path to a specific OptimizerProfile asset (e.g. Assets/Settings/Handheld.asset). Overrides -fuzzyProfile. |
-fuzzyScenes | build, all, or semicolon/comma-separated paths | build | build audits enabled scenes in Build Settings; all audits every scene under Assets/; or supply explicit file paths. |
-fuzzyOutput | Directory path | FuzzyOptimizerReports/<timestamp> | Destination folder for report.json and report.html. |
-fuzzyMinScore | Integer 0 – 100 | 0 (Disabled) | Fails the quality gate if any scene scores below this threshold. |
-fuzzyFailOnCritical | Flag | Off | Fails the quality gate immediately if any scene contains a Critical severity issue. |
Process Exit Codes
| Exit Code | Meaning | CI Handling |
|---|---|---|
| 0 | Passed | All audited scenes met or exceeded the quality gate criteria. |
| 1 | Quality Gate Failed | One or more scenes failed the minimum score or had Critical issues. Reasons are logged as errors. |
| 2 | CLI Error | Invalid arguments, missing profile asset, or unhandled exception during execution. |
Do Not Pass -quit
Do not pass Unity’s -quit command line switch; the FuzzyOptimizerCLI automatically handles editor termination and sets the appropriate process exit code.
GitHub Actions CI Workflow Example
name: Performance Audit Gate
on: pull_request: branches: [ main, develop ]
jobs: audit: runs-on: self-hosted steps: - name: Checkout Code uses: actions/checkout@v4
- name: Run FuzzyOptimizer Scene Audit run: > "$UNITY_PATH" -batchmode -nographics -projectPath . -logFile - -executeMethod FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports.FuzzyOptimizerCLI.Audit -fuzzyProfile DesktopMid -fuzzyMinScore 70 -fuzzyFailOnCritical -fuzzyOutput Reports/
- name: Upload Audit Artifacts uses: actions/upload-artifact@v4 if: always() with: name: fuzzy-optimizer-report path: Reports/Player Build Check (Build Quality Gate)
FuzzyOptimizer includes an optional Player Build Quality Gate that audits scenes automatically whenever a developer or CI pipeline builds a player binary (BuildPlayer).
Configure this feature in the dashboard Settings tab:
| Setting | Default | Description |
|---|---|---|
| Build Check Enabled | false | When enabled, intercepts the Unity build pipeline via IProcessSceneWithReport. |
| Target Profile | DesktopMid | Performance profile used to audit scenes during the build process. |
| Min Score | 0 (Disabled) | Minimum score required for scenes to pass the build gate. |
| Fail On Critical | false | Halts the build immediately if any scene triggers a Critical issue. |
Failure Behavior
If a scene violates the quality gate during a player build, FuzzyOptimizer aborts the build process by throwing a BuildFailedException that specifies the failing scene, the offending rules, and the path to the exported HTML report.
All build check settings are serialized to ProjectSettings/FuzzyOptimizerSettings.json, ensuring the entire team enforces the identical build gate.
C# Scripting API
You can trigger programmatic scene audits in custom editor tools:
using FuzzyLogicLabs.FuzzyOptimizer.Editor.Audit;using FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports;using FuzzyLogicLabs.FuzzyOptimizer.Runtime.Core;
// 1. Instantiate or load a profilevar profile = OptimizerProfile.CreateDefaultProfile(OptimizerTargetPlatform.Mobile);
// 2. Run the audit against all open scenesAuditReport report = SceneAuditor.RunAudit(profile);
// 3. Inspect resultsDebug.Log($"Scene Health Score: {report.OverallScore}/100");Debug.Log($"Critical Issues Found: {report.CriticalCount}");
// 4. Export report files to diskstring outputDir = "FuzzyOptimizerReports/CustomExport";ReportExporter.ExportJson(report, outputDir);ReportExporter.ExportHtml(report, outputDir);