1+ name : Build the App and Run AppInspect
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' packages/**'
7+ types : [opened, reopened, synchronize]
8+
9+ # Allow only 1 concurrent execution
10+ concurrency :
11+ group : ${{ github.workflow }}-${{ github.ref }}
12+ cancel-in-progress : true
13+
14+ jobs :
15+ build :
16+ name : Generate App Bundle
17+ runs-on : ubuntu-latest
18+ outputs :
19+ artifact_name : ${{ steps.app.outputs.artifact_name }}
20+ steps :
21+ - uses : actions/checkout@v4
22+ - name : Read App Info
23+ id : app
24+ run : |
25+ app_id=$(cat splunk-*/app.manifest | jq -r '.info.id.name')
26+ app_version=$(cat splunk-*/app.manifest | jq -r '.info.id.version')
27+ echo "name=${app_id}" >> $GITHUB_OUTPUT
28+ echo "version=${app_version}" >> $GITHUB_OUTPUT
29+ echo "artifact_name=${app_id}-${app_version}" >> $GITHUB_OUTPUT
30+ working-directory : ./packages
31+
32+ - name : Bundle App Source
33+ env :
34+ APP_NAME : ${{ steps.app.outputs.name }}
35+ APP_VERSION : ${{ steps.app.outputs.version }}
36+ run : |
37+ # Exclude images from README file
38+ sed -i '/^!/d' README.md
39+ cp README.md packages/$APP_NAME
40+ tar -C packages -zcvf $APP_NAME-$APP_VERSION.tar.gz $APP_NAME/
41+
42+ - name : Upload artifact
43+ uses : actions/upload-artifact@v4
44+ with :
45+ name : ${{ steps.app.outputs.artifact_name }}
46+ path : ${{ steps.app.outputs.name }}*.tar.gz
47+
48+ slim-validate :
49+ name : SLIM Validation
50+ needs : build
51+ runs-on : ubuntu-latest
52+ strategy :
53+ matrix :
54+ python-version : [ 3.9 ]
55+ steps :
56+ - name : Download artifact
57+ uses : actions/download-artifact@v4
58+ with :
59+ name : ${{ needs.build.outputs.artifact_name }}
60+
61+ - name : Set up Python
62+ uses : actions/setup-python@v5
63+ with :
64+ python-version : ${{ matrix.python-version }}
65+
66+ - name : Install dependencies
67+ run : |
68+ python -m pip install --upgrade pip
69+ pip install splunk-packaging-toolkit
70+
71+ - name : Slim Validate
72+ run : slim validate *.tar.gz
73+
74+ appinspect-cli :
75+ name : AppInspect CLI ${{ matrix.tags }}
76+ needs : build
77+ runs-on : ubuntu-latest
78+ strategy :
79+ matrix :
80+ tags :
81+ - " cloud"
82+ - " private_app"
83+ - " private_classic"
84+ - " private_victoria"
85+ steps :
86+ - uses : actions/download-artifact@v4
87+ with :
88+ name : ${{ needs.build.outputs.artifact_name }}
89+ path : dist
90+ 91+ with :
92+ app_path : dist
93+ included_tags : ${{ matrix.tags }}
0 commit comments