@@ -94,11 +94,18 @@ jobs:
94
94
app_repository : ${{ inputs.app_repository }}
95
95
app_branch_name : ${{ inputs.app_branch_name }}
96
96
compatible_devices : ${{ inputs.run_for_devices }}
97
+
98
+ call_get_test_metadata :
99
+ name : Retrieve test metadata
100
+ uses : ./.github/workflows/_get_test_metadata.yml
101
+ with :
102
+ app_repository : ${{ inputs.app_repository }}
103
+ app_branch_name : ${{ inputs.app_branch_name }}
97
104
pytest_directory : ${{ inputs.test_dir }}
98
105
99
106
ragger_tests :
100
107
name : Functional tests with Ragger
101
- needs : call_get_app_metadata
108
+ needs : [ call_get_app_metadata, call_get_test_metadata]
102
109
strategy :
103
110
fail-fast : false
104
111
matrix :
@@ -109,7 +116,7 @@ jobs:
109
116
steps :
110
117
- name : Check metadata
111
118
run : |
112
- if [ '${{ needs.call_get_app_metadata .outputs.pytest_directory }}' = 'None' ]; then
119
+ if [ '${{ needs.call_get_test_metadata .outputs.pytest_directory }}' = 'None' ]; then
113
120
>&2 echo "ERROR: This workflow either needs a 'ledger_app.toml' manifest with a 'tests.pytest_directory' section, or be configured with a valid 'test_dir' parameter"
114
121
exit 1
115
122
fi
@@ -164,32 +171,32 @@ jobs:
164
171
uses : actions/download-artifact@v4
165
172
with :
166
173
name : ${{ inputs.lib_binaries_artifact }}
167
- path : ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/lib_binaries/
174
+ path : ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/lib_binaries/
168
175
169
176
- name : Display structure of downloaded files
170
177
if : ${{ inputs.lib_binaries_artifact != '' }}
171
- run : ls -R ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/lib_binaries/
178
+ run : ls -R ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/lib_binaries/
172
179
173
180
- name : Install tests dependencies
174
181
run : |
175
182
sudo apt-get update && sudo apt-get install -y qemu-user-static tesseract-ocr libtesseract-dev
176
183
pip install -U pip packaging setuptools
177
- pip install -r "${{ needs.call_get_app_metadata .outputs.pytest_directory }}/requirements.txt"
178
- if [ -f ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/setup_script.sh ]; then
179
- ./${{ needs.call_get_app_metadata .outputs.pytest_directory }}/setup_script.sh
184
+ pip install -r "${{ needs.call_get_test_metadata .outputs.pytest_directory }}/requirements.txt"
185
+ if [ -f ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/setup_script.sh ]; then
186
+ ./${{ needs.call_get_test_metadata .outputs.pytest_directory }}/setup_script.sh
180
187
fi
181
188
182
189
- name : Clear legacy snapshots
183
190
if : ${{ inputs.regenerate_snapshots == true }}
184
191
run : |
185
- rm -rf ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/snapshots
192
+ rm -rf ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/snapshots
186
193
187
194
- name : Run test
188
195
env :
189
196
CTEST_OUTPUT_ON_FAILURE : 1
190
197
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION : python
191
198
run : |
192
- pytest ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/ \
199
+ pytest ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/ \
193
200
--tb=short -v \
194
201
--device ${{ matrix.device }} \
195
202
-k ${{ inputs.test_filter }} \
@@ -203,14 +210,14 @@ jobs:
203
210
with :
204
211
# Make the artifact name unique to allow running this job in parallel
205
212
name : tests_snapshots${{ inputs.test_options }}-${{ matrix.device }}
206
- path : ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/snapshots-tmp
213
+ path : ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/snapshots-tmp
207
214
208
215
- name : Upload snapshots on success if needed
209
216
if : ${{ inputs.regenerate_snapshots == true }}
210
217
uses : actions/upload-artifact@v4
211
218
with :
212
219
name : tests_snapshots${{ inputs.test_options }}-${{ matrix.device }}
213
- path : ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/snapshots-tmp
220
+ path : ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/snapshots-tmp
214
221
215
222
- name : Set upload flag
216
223
id : upload-flag
@@ -246,4 +253,4 @@ jobs:
246
253
app_repository : ${{ inputs.app_repository }}
247
254
app_branch_name : ${{ inputs.app_branch_name }}
248
255
snapshots_artifact_name : ${{ needs.merge_artifacts_if_needed.outputs.snapshot_artifact_name }}
249
- snapshots_directory : ${{ needs.call_get_app_metadata .outputs.pytest_directory }}/snapshots
256
+ snapshots_directory : ${{ needs.call_get_test_metadata .outputs.pytest_directory }}/snapshots
0 commit comments