(PIE-1770) Migrate add-on to UCC Framework (v2.0.0) #34
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: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install UCC framework | |
| run: pip install -r requirements-dev.txt | |
| - name: Install Python runtime dependencies into lib/ | |
| run: pip install -r requirements.txt --target TA-puppet-alert-orchestrator/lib | |
| - name: Build configuration page (UCC) | |
| run: ucc-gen build --source TA-puppet-alert-orchestrator | |
| - name: Upload built app | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: built-app | |
| path: output/ | |
| appinspect: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install AppInspect | |
| run: pip install splunk-appinspect | |
| - name: Download built app | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: built-app | |
| - name: Run AppInspect | |
| run: splunk-appinspect inspect TA-puppet-alert-orchestrator --output-file appinspect_result.json --mode precert --included-tags cloud | |
| - 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@v7 | |
| with: | |
| script: core.setFailed('AppInspect contains errors!') | |
| - name: AppInspect Failures | |
| if: ${{ steps.appinspect-failures.outputs.fail_count > 0 }} | |
| uses: actions/github-script@v7 | |
| with: | |
| script: core.setFailed('AppInspect contains failures!') | |
| - name: Upload AppInspect Results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: AppInspect_TA-puppet-alert-orchestrator | |
| path: appinspect_result.json |