Skip to content

Commit bd160b1

Browse files
committed
CI: Run Launchable in the build directory
Use the build directory as the Launchable session directory as well as compilers/entrypoint.sh.
1 parent 2eb0a1a commit bd160b1

1 file changed

Lines changed: 34 additions & 92 deletions

File tree

.github/actions/launchable/setup/action.yml

Lines changed: 34 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ inputs:
5757
5858
outputs:
5959
stdout_report_path:
60-
value: ${{ steps.variables.outputs.stdout_report_path }}
60+
value: ${{ steps.global.outputs.stdout_report_file }}
6161
description: >-
6262
Report file path for standard output.
6363
6464
stderr_report_path:
65-
value: ${{ steps.variables.outputs.stderr_report_path }}
65+
value: ${{ steps.global.outputs.stderr_report_file }}
6666
description: >-
6767
Report file path for standard error.
6868
@@ -117,8 +117,25 @@ runs:
117117
echo test_all_report_file='launchable_test_all_report.json' >> $GITHUB_OUTPUT
118118
echo btest_report_file='launchable_btest_report.json' >> $GITHUB_OUTPUT
119119
echo test_spec_report_dir='launchable_test_spec_report' >> $GITHUB_OUTPUT
120+
echo stdout_report_file=launchable_stdout.log" >> $GITHUB_OUTPUT
121+
echo stderr_report_file=launchable_stderr.log" >> $GITHUB_OUTPUT
120122
if: steps.enable-launchable.outputs.enable-launchable
121123

124+
- name: Clean up session files in Launchable
125+
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
126+
with:
127+
shell: bash
128+
working-directory: ${{ inputs.srcdir }}
129+
post: |
130+
rm -f "${test_all_session_file}"
131+
rm -f "${btest_session_file}"
132+
rm -f "${test_spec_session_file}
133+
if: steps.enable-launchable.outputs.enable-launchable
134+
env:
135+
test_all_session_file: ${{ steps.global.outputs.test_all_session_file }}
136+
btest_session_file: ${{ steps.global.outputs.btest_session_file }}
137+
test_spec_session_file: ${{ steps.global.outputs.test_spec_session_file }}
138+
122139
- name: Set environment variables for Launchable
123140
shell: bash
124141
run: |
@@ -148,7 +165,6 @@ runs:
148165
- name: Set up Launchable
149166
id: setup-launchable
150167
shell: bash
151-
working-directory: ${{ inputs.srcdir }}
152168
run: |
153169
set -x
154170
pip install --user launchable
@@ -236,124 +252,50 @@ runs:
236252
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
237253
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
238254

239-
- name: Clean up session files in Launchable
240-
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
241-
with:
242-
shell: bash
243-
working-directory: ${{ inputs.srcdir }}
244-
post: |
245-
rm -f "${test_all_session_file}"
246-
rm -f "${btest_session_file}"
247-
rm -f "${test_spec_session_file}
248-
if: always() && steps.setup-launchable.outcome == 'success'
249-
env:
250-
test_all_session_file: ${{ steps.global.outputs.test_all_session_file }}
251-
btest_session_file: ${{ steps.global.outputs.btest_session_file }}
252-
test_spec_session_file: ${{ steps.global.outputs.test_spec_session_file }}
253-
254-
- name: Clean up test results in Launchable
255-
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
256-
with:
257-
shell: bash
258-
working-directory: ${{ inputs.builddir }}
259-
post: |
260-
rm -f "${test_all_report_file}"
261-
rm -f "${btest_report_file}"
262-
rm -fr "${test_spec_report_dir}"
263-
rm -f launchable_stdout.log
264-
rm -f launchable_stderr.log
265-
if: always() && steps.setup-launchable.outcome == 'success'
266-
env:
267-
test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
268-
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
269-
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
270-
271-
- name: Variables to report Launchable
272-
id: variables
273-
shell: bash
274-
working-directory: ${{ inputs.srcdir }}
275-
run: |
276-
set -x
277-
: # report-path from srcdir
278-
if [ "${srcdir}" = "${{ github.workspace }}" ]; then
279-
dir=
280-
else
281-
# srcdir must be equal to or under workspace
282-
dir=$(echo ${srcdir:+${srcdir}/} | sed 's:[^/][^/]*/:../:g')
283-
fi
284-
if [ "${test_all_enabled}" = "true" ]; then
285-
test_report_path="${dir}${builddir:+${builddir}/}${test_all_report_file}"
286-
echo test_report_path="${test_report_path}" >> $GITHUB_OUTPUT
287-
fi
288-
if [ "${btest_enabled}" = "true" ]; then
289-
btest_report_path="${dir}${builddir:+${builddir}/}${btest_report_file}"
290-
echo btest_report_path="${btest_report_path}" >> $GITHUB_OUTPUT
291-
fi
292-
if [ "${test_spec_enabled}" = "true" ]; then
293-
test_spec_report_path="${dir}${builddir:+${builddir}/}${test_spec_report_dir}"
294-
mkdir "${test_spec_report_path}"
295-
echo test_spec_report_path="${test_spec_report_path}" >> $GITHUB_OUTPUT
296-
fi
297-
stdout_report_path="${dir}${builddir:+${builddir}/}launchable_stdout.log"
298-
stderr_report_path="${dir}${builddir:+${builddir}/}launchable_stderr.log"
299-
echo stdout_report_path="${stdout_report_path}" >> $GITHUB_OUTPUT
300-
echo stderr_report_path="${stderr_report_path}" >> $GITHUB_OUTPUT
301-
if: steps.enable-launchable.outputs.enable-launchable
302-
env:
303-
srcdir: ${{ inputs.srcdir }}
304-
builddir: ${{ inputs.builddir }}
305-
test_all_enabled: ${{ steps.global.outputs.test_all_enabled }}
306-
btest_enabled: ${{ steps.global.outputs.btest_enabled }}
307-
test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }}
308-
test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
309-
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
310-
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
311-
312255
- name: Record test results in Launchable
313256
uses: gacts/run-and-post-run@674528335da98a7afc80915ff2b4b860a0b3553a # v1.4.0
314257
with:
315258
shell: bash
316-
working-directory: ${{ inputs.srcdir }}
317259
post: |
318260
if [[ "${test_all_enabled}" = "true" ]]; then \
319261
launchable record attachment \
320262
--session "$(cat "${test_all_session_file}")" \
321-
"${stdout_report_path}" \
322-
"${stderr_report_path}"; \
263+
"${stdout_report_file}" \
264+
"${stderr_report_file}"; \
323265
launchable record tests \
324266
--session "$(cat "${test_all_session_file}")" \
325-
raw "${test_report_path}" || true; \
267+
raw "${test_all_report_file}" || true; \
326268
fi
327269
328270
if [[ "${btest_enabled}" = "true" ]]; then \
329271
launchable record attachment \
330272
--session "$(cat "${btest_session_file}")" \
331-
"${stdout_report_path}" \
332-
"${stderr_report_path}"; \
273+
"${stdout_report_file}" \
274+
"${stderr_report_file}"; \
333275
launchable record tests \
334276
--session "$(cat "${btest_session_file}")" \
335-
raw "${btest_report_path}" || true; \
277+
raw "${btest_report_file}" || true; \
336278
fi
337279
338280
if [[ "${test_spec_enabled}" = "true" ]]; then \
339281
launchable record attachment \
340282
--session "$(cat "${test_spec_session_file}")" \
341-
"${stdout_report_path}" \
342-
"${stderr_report_path}"; \
283+
"${stdout_report_file}" \
284+
"${stderr_report_file}"; \
343285
launchable record tests \
344286
--session "$(cat "${test_spec_session_file}")" \
345-
raw ${test_spec_report_path}/* || true; \
287+
raw ${test_spec_report_dir}/* || true; \
346288
fi
347-
if: ${{ always() && steps.enable-launchable.outputs.enable-launchable }}
289+
if: always() && steps.setup-launchable.outcome == 'success'
348290
env:
349-
test_report_path: ${{ steps.variables.outputs.test_report_path }}
350-
btest_report_path: ${{ steps.variables.outputs.btest_report_path }}
351-
test_spec_report_path: ${{ steps.variables.outputs.test_spec_report_path }}
291+
test_all_report_file: ${{ steps.global.outputs.test_all_report_file }}
292+
btest_report_file: ${{ steps.global.outputs.btest_report_file }}
293+
test_spec_report_dir: ${{ steps.global.outputs.test_spec_report_dir }}
352294
test_all_enabled: ${{ steps.global.outputs.test_all_enabled }}
353295
btest_enabled: ${{ steps.global.outputs.btest_enabled }}
354296
test_spec_enabled: ${{ steps.global.outputs.test_spec_enabled }}
355297
test_all_session_file: ${{ steps.global.outputs.test_all_session_file }}
356298
btest_session_file: ${{ steps.global.outputs.btest_session_file }}
357299
test_spec_session_file: ${{ steps.global.outputs.test_spec_session_file }}
358-
stdout_report_path: ${{ steps.variables.outputs.stdout_report_path }}
359-
stderr_report_path: ${{ steps.variables.outputs.stderr_report_path }}
300+
stdout_report_file: ${{ steps.global.outputs.stdout_report_file }}
301+
stderr_report_file: ${{ steps.global.outputs.stderr_report_file }}

0 commit comments

Comments
 (0)