Skip to content

Commit abb7e3a

Browse files
Fixed location of finding error file to be more specific
1 parent 1317b53 commit abb7e3a

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

.github/workflows/NightlyBMDB_CLI.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -246,20 +246,20 @@ jobs:
246246
247247
for file in $SOURCE_DIR/*; do
248248
# Is the file of the correct form?
249-
base_name=$(basename $file)
250-
if ! [[ $base_name =~ ^BIOMD[0-9]+\.omex$ ]]; then
251-
echo "Input is invalid. Expecting `BIOMD##########.omex` format, got `${base_name}`."
249+
file_name=$(basename $file)
250+
if ! [[ $file_name =~ ^BIOMD[0-9]+\.omex$ ]]; then
251+
echo "Input is invalid. Expecting 'BIOMD##########.omex format, got '${file_name}'."
252252
continue
253253
fi
254254
# ...is it the infamous BioModel 1008?
255-
if [[ $base_name == *1008* ]]; then
255+
if [[ $file_name == *1008* ]]; then
256256
echo -n 'skipping '
257-
echo $base_name
257+
echo $file_name
258258
continue
259259
fi
260-
number=$(echo "$base_name" | sed -n 's/^BIOMD\([0-9]\+\)\.omex$/\1/p' | sed 's/^0*//')
260+
number=$(echo "$file_name" | sed -n 's/^BIOMD\([0-9]\+\)\.omex$/\1/p' | sed 's/^0*//')
261261
if [ $((number % ${{ strategy.job-total }})) -eq $((MOD_VALUE + 0)) ]; then
262-
echo "Accepting ${base_name}"
262+
echo "Accepting ${file_name}"
263263
cp ${file} $TARGET_DIR/
264264
fi
265265
done
@@ -268,24 +268,29 @@ jobs:
268268
- name: Begin Execution
269269
#$(docker image ls | grep "<none>" | awk '{print $3;}') to get image id
270270
run: |
271-
if [ ${{ matrix.sets }} -eq 4 ] || [ ${{ matrix.sets }} -eq 2 ]; then
271+
if [ ${{ matrix.sets }} -eq 4 ] || [ ${{ matrix.sets }} -eq 6 ]; then
272272
# The /* goes on the outside, otherwise bash just interprets a string!
273273
for file in "$GITHUB_WORKSPACE/set_${{ matrix.sets }}"/*; do
274274
echo "\"$file\""
275275
if [ -f "$file" ]; then
276-
base_name="${file%.*}"
277-
mkdir "${base_name}_output"
278-
echo "Running \"$file\" in output folder \"${base_name}_output\""
279-
sim_input="/root/$(basename ${file})"
280-
sim_output="/root/$(basename ${base_name})_output"
281-
docker run -v $GITHUB_WORKSPACE/set_${{ matrix.sets }}:/root $(docker image ls | grep "<none>" | awk '{print $3;}') execute -d -i $sim_input -o $sim_output --writeLogFiles --guaranteeGoodReturnCode
276+
extensionless_name="${file%.*}"
277+
base_name="$(basename ${file})"
278+
base_extless_name="$(basename ${extensionless_name})"
279+
mkdir "${extensionless_name}_output"
280+
echo "Running \"${file}\" in output folder \"${base_extless_name}_output\""
281+
sim_input="/root/${base_name}"
282+
sim_output="/root/${base_extless_name}_output"
283+
docker run -v $GITHUB_WORKSPACE/set_${{ matrix.sets }}:/root $(docker image ls | grep "<none>" | awk '{print $3;}') execute -d -i ${sim_input} -o ${sim_output} --writeLogFiles --guaranteeGoodReturnCode
284+
282285
echo -e "\n\n\n\n\n" # give ourselves some line separation
283286
# Check for individual Success
284-
if [ $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }} -name errorLog.txt | wc -l) -ne 0 ]
287+
if [ $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }}/${base_extless_name}_output -name errorLog.txt | wc -l) -ne 0 ]
285288
then
286289
# Copy error log to github workspace
287290
touch ${{ github.workspace }}/errors.report
288-
cat $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }} -name errorLog.txt) >> ${{ github.workspace }}/errors.report
291+
cat $(find $GITHUB_WORKSPACE/set_${{ matrix.sets }}/${base_extless_name}_output -name errorLog.txt) >> ${{ github.workspace }}/errors.report
292+
else
293+
echo "No errors found in set $GITHUB_WORKSPACE/set_${{ matrix.sets }}"
289294
fi
290295
fi
291296
done

0 commit comments

Comments
 (0)