Project Auditor CI Tool
A small experimental Unity Editor package for running Unity Project Auditor in CI with GitHub Actions.
com.kvcl.project-auditor-ci Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/project-auditor-ci.git 
README Markdown
Copy this to your project's README.md
## Installation
Add **Project Auditor CI Tool** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/project-auditor-ci.git
```
[](https://www.pkglnk.dev/pkg/project-auditor-ci)Dependencies (1)
README
Unity Project Auditor CI (Package)
A small experimental Unity Editor package for running Unity Project Auditor in CI with GitHub Actions.
Once the audit completes, extensions generate:
- a SARIF file for GitHub code scanning
- GitHub annotations
- a Markdown summary for GitHub Actions
Notes
- SARIF includes only
CriticalandMajorissues with file paths. - GitHub annotations emit
::errorforCriticalissues and::warningforMajorissues. - The Markdown summary includes the top 10
CriticalandMajorissues after filtering. - The native
.projectauditorfile is still saved in full.
Install via UPM
This package can be installed directly from a GitHub repository using Unity Package Manager.
In Unity:
- Open Window > Package Manager
- Click the + button
- Select Add package from git URL...
- Paste the repository URL
Example:
https://github.com/keiranlovett/unity-project-auditor-ci-package.git
Or manually
{
"dependencies": {
"com.kvcl.project-auditor-ci": "https://github.com/keiranlovett/unity-project-auditor-ci-package.git"
}
}
Usage
Use this method in CI:
ProjectAuditorCI.AuditAndExport
Working with GitHub Actions
The included sample workflow runs the audit in CI, publishes a Markdown summary to the GitHub Actions job summary, uploads SARIF for GitHub code scanning, and uploads the raw .projectauditor report as an artifact.
A sample workflow is included at:
Samples/unity-project-auditor.yml
In your project this file should be renamed and moved to the workflows folder:
.github/workflows/project-auditor.yml
Then configure the required Unity secrets in your GitHub repository:
- UNITY_LICENSE
- UNITY_EMAIL
- UNITY_PASSWORD
You can copy and use as is, or modify it to better suit your project.
Environment variables
Failure Behaviour
PROJECT_AUDITOR_FAIL_THRESHOLD— Fails the run when the total issue count meets or exceeds this value.PROJECT_AUDITOR_FAIL_ON_ANY_ISSUE— Fails the run if any issue is found.
Output Paths
PROJECT_AUDITOR_REPORT— Output path for the.projectauditorreport file.PROJECT_AUDITOR_SARIF— Output path for the SARIF file.PROJECT_AUDITOR_SUMMARY— Output path for the.mdsummary file.
Audit Scope
PROJECT_AUDITOR_CATEGORIES— Comma-separated list of Project Auditor categories to include in the audit.PROJECT_AUDITOR_ASSEMBLIES— Comma-separated list of Assemblies to audit.PROJECT_AUDITOR_PLATFORM— (Optional) Build target override used for the audit. Use a validUnityEditor.BuildTargetvalue such asStandaloneWindows64,Android,iOS, orWebGL. See the official UnityBuildTargetdocumentation.PROJECT_AUDITOR_CODE_OPTIMIZATION— (Optional) Code optimisation mode used during analysis. Valid values areDebugandRelease. See the official UnityCodeOptimizationdocumentation.PROJECT_AUDITOR_COMPILATION_MODE— (Optional) Compilation mode used when auditing code. Valid values areEditorandPlayer. See the official Unity Project AuditorCompilationModedocumentation.
Example:
PROJECT_AUDITOR_ASSEMBLIES=MyGame.Core,MyGame.Runtime
Output filtering
PROJECT_AUDITOR_EXCLUDE_PATH_PREFIXES- Suppresses package and and any other paths from reporting outputs.
Example:
PROJECT_AUDITOR_EXCLUDE_PATH_PREFIXES=Packages/com.unity.,Library/PackageCache/
TODO:
- Improved Extensions Support
- Extension: Per Assembly Reports
License
MIT License
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In