(PIE-1770) Migrate add-on to UCC Framework (v2.0.0) #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Validate Splunk App | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| appinspect: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build and validation dependencies | |
| run: pip install -r requirements-dev.txt | |
| - name: Build configuration page (UCC) | |
| run: ucc-gen build --source TA-puppet-alert-orchestrator | |
| - name: Run AppInspect | |
| run: splunk-appinspect inspect output/TA-puppet-alert-orchestrator --output-file appinspect_result.json --mode precert --included-tags cloud | |
| - name: Upload AppInspect Results | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: AppInspect_TA-puppet-alert-orchestrator | |
| path: appinspect_result.json | |
| - name: Check AppInspect Errors | |
| id: appinspect-errors | |
| run: | | |
| error_check=$(jq '.summary.error' appinspect_result.json) | |
| echo "error_count=$error_check" >> $GITHUB_OUTPUT | |
| - name: Check AppInspect Failures | |
| id: appinspect-failures | |
| run: | | |
| fail_check=$(jq '.summary.failure' appinspect_result.json) | |
| echo "fail_count=$fail_check" >> $GITHUB_OUTPUT | |
| - name: AppInspect Errors | |
| if: ${{ steps.appinspect-errors.outputs.error_count > 0 }} | |
| uses: actions/github-script@v9 | |
| with: | |
| script: core.setFailed('AppInspect contains errors!') | |
| - name: AppInspect Failures | |
| if: ${{ steps.appinspect-failures.outputs.fail_count > 0 }} | |
| uses: actions/github-script@v9 | |
| with: | |
| script: core.setFailed('AppInspect contains failures!') |