@@ -116,10 +116,31 @@ jobs:
116116 name : package
117117 path : dist/*
118118 if : always()
119-
119+
120+ prerequisites-ui-tests :
121+ runs-on : ubuntu-latest
122+ outputs :
123+ ta_example_version : ${{ steps.ta-example.outputs.version }}
124+ steps :
125+ - name : Fetch latest version of Splunk_TA example
126+ id : ta-example
127+ run : |
128+ ta_example_version=`basename $(curl -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | jq -r '.assets | last | .browser_download_url')`
129+ echo "version=$ta_example_version" >> $GITHUB_OUTPUT
130+ - name : Cache Splunk_TA example
131+ id : cache_ta
132+ uses : actions/cache@v3
133+ with :
134+ path : Splunk_TA*.spl
135+ key : ${{ steps.ta-example.outputs.version }}
136+ - name : Download Splunk_TA example
137+ if : steps.cache_ta.outputs.cache-hit != 'true'
138+ run : curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | jq -r '.assets | last | .browser_download_url' | wget -i -
139+
120140 run-ui-tests :
121141 needs :
122142 - build
143+ - prerequisites-ui-tests
123144 runs-on : ubuntu-latest
124145 strategy :
125146 fail-fast : false
@@ -146,31 +167,24 @@ jobs:
146167 run : |
147168 git submodule sync
148169 git submodule update --recursive --remote
149- - name : Downloading Example-TA
150- run : |
151- cd tests/deps/splunk-add-on-for-ucc-example
152- mkdir output
153- cd output
154- pwd
155- curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | grep "Splunk_TA.*.spl" | grep -v search_head | grep -v indexer | grep -v forwarder | cut -d : -f 2,3 | tr -d \" | wget -qi - || true
156- ls
157- tar -xzf Splunk_TA*.spl
158- ls
159- rm Splunk_TA*.spl
160- ls
170+ - name : Cache Splunk_TA example
171+ id : cache_ta
172+ uses : actions/cache@v3
173+ with :
174+ path : Splunk_TA*.spl
175+ key : ${{ needs.prerequisites-ui-tests.outputs.ta_example_version }}
161176 - name : Setup for testing
162177 run : |
163- echo "Setup for Testing..."
164- pip install git+https://github.com/pixelb/crudini
165- mkdir test-results
166- cp -r tests/deps/splunk-add-on-for-ucc-example/output output
178+ mkdir output test-results
179+ tar -xvf Splunk_TA*.spl -C output/
180+ pip install git+https://github.com/pixelb/crudini
167181 - name : Splunk Testing
168182 run : |
169183 SPLUNK_VERSION=$(crudini --get tests/deps/build/addonfactory_test_matrix_splunk/splunk_matrix.conf "${{ matrix.splunk }}" VERSION)
170184 export SPLUNK_VERSION
171185 SPLUNK_APP_ID=$(crudini --get tests/deps/splunk-add-on-for-ucc-example/package/default/app.conf id name)
172186 export SPLUNK_APP_ID
173- SPLUNK_APP_PACKAGE=tests/deps/splunk-add-on-for-ucc-example/ output/$(ls tests/deps/splunk-add-on-for-ucc-example/ output/)
187+ SPLUNK_APP_PACKAGE=output/$(ls output/)
174188 export SPLUNK_APP_PACKAGE
175189 export TEST_SET=tests/ui
176190 export TEST_BROWSER="${{ matrix.browser }}"
0 commit comments