-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun-oft.sh
More file actions
executable file
·32 lines (28 loc) · 1.21 KB
/
run-oft.sh
File metadata and controls
executable file
·32 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
fail_on_error=${OFT_FAIL_ON_ERROR:-"false"}
report_file_name=${OFT_REPORT_FILENAME:-"trace-report.txt"}
report_format=${OFT_REPORT_FORMAT:-"plain"}
tags=${OFT_TAGS:-""}
file_patterns=${OFT_FILE_PATTERNS:-"."}
options=(-o "$report_format" -f "$report_file_name")
# [impl->req~filter-specitems-using-tags~1]
if [[ -n "$tags" ]]; then
options=("${options[@]}" -t "$tags")
fi
echo "::notice::using OpenFastTrace JARs from: ${LIB_DIR}"
echo "::notice::running OpenFastTrace for file patterns: $file_patterns"
# [impl->req~run-oft-trace-command~1]
# shellcheck disable=SC2086
# we need to provide the file patterns unquoted in order for the shell to expand any glob patterns like "*.md"
if (java -cp "${LIB_DIR}/*" org.itsallcode.openfasttrace.core.cli.CliStarter trace "${options[@]}" $file_patterns)
then
echo "oft-exit-code=0" >> "${GITHUB_OUTPUT}"
echo "All specification items are covered." >> "${GITHUB_STEP_SUMMARY}"
else
oft_exit_code=$?
echo "oft-exit-code=${oft_exit_code}" >> "${GITHUB_OUTPUT}"
echo "Some specification items are not covered. See created report (${report_file_name}) for details." >> "${GITHUB_STEP_SUMMARY}"
if [ "${fail_on_error}" = "true" ]; then
exit ${oft_exit_code}
fi
fi