@@ -129,34 +129,32 @@ jobs:
129129 shell : bash -l {0}
130130 continue-on-error : true
131131 run : |
132- LOG_FILE=rohub_upload_error.log
133-
134- # Run Python and capture all stdout+stderr
135- python benchmarks/common/upload_provenance.py \
136- --provenance_folderpath "./${SNAKEMAKE_RESULT_FILE}.zip" \
137- --benchmark_name "linear-elastic-plate-with-hole" \
138- --username "${{ secrets.ROHUB_USERNAME }}" \
139- --password "${{ secrets.ROHUB_PASSWORD }}" \
140- 2>&1 | tee "$LOG_FILE"
141-
142- PYTHON_EXIT_CODE=${PIPESTATUS[0]}
143-
144- # Check exit code: 0 = failure, 1 = success (per your convention)
145- if [ $PYTHON_EXIT_CODE -eq 0 ]; then
146- echo "=== RoHub upload failed — see log below ==="
147- cat "$LOG_FILE"
132+ LOG_FILE="${GITHUB_WORKSPACE}/rohub_upload_error.log"
133+
134+ # Run Python and capture stdout+stderr
135+ OUTPUT="$(
136+ python benchmarks/common/upload_provenance.py \
137+ --provenance_folderpath "./${SNAKEMAKE_RESULT_FILE}.zip" \
138+ --benchmark_name "linear-elastic-plate-with-hole" \
139+ --username "${{ secrets.ROHUB_USERNAME }}" \
140+ --password "${{ secrets.ROHUB_PASSWORD }}" \
141+ 2>&1
142+ )"
143+ PYTHON_EXIT_CODE=$?
144+
145+ # Standard convention: 0 = success, non-zero = failure
146+ if [ "$PYTHON_EXIT_CODE" -eq 0 ]; then
147+ echo "RoHub upload succeeded"
148+ rm -f "$LOG_FILE" || true
148149 else
149- echo "✅ RoHub upload succeeded "
150- rm -f "$LOG_FILE"
150+ echo "=== RoHub upload failed — writing log to $LOG_FILE === "
151+ printf '%s\n' "$OUTPUT" | tee "$LOG_FILE"
151152 fi
152153
153- # Export exit code for subsequent steps if needed
154- echo "python_exit_code=$PYTHON_EXIT_CODE" >> $GITHUB_ENV
155-
156154 - name : Upload RoHub error log
157- if : ${{ env.python_exit_code == '0' }}
155+ if : always()
158156 uses : actions/upload-artifact@v4
159157 with :
160158 name : rohub-upload-error-log
161- path : rohub_upload_error.log
162-
159+ path : ${{ github.workspace }}/ rohub_upload_error.log
160+ if-no-files-found : ignore
0 commit comments