Skip to content

Commit a866ac0

Browse files
committed
Add RoHub Upload
1 parent fea512a commit a866ac0

1 file changed

Lines changed: 39 additions & 1 deletion

File tree

.github/workflows/run-benchmark-examples.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ jobs:
8888
results_artifact: fenics_results_linear-elastic-plate-with-hole
8989
rocrate_filename: Fenics-RoCrate.zip
9090
plot_filename: fenics-element-size-vs-stress-plot.pdf
91-
9291
steps:
9392
- name: Checkout repo content
9493
uses: actions/checkout@v2
@@ -133,4 +132,43 @@ jobs:
133132
with:
134133
name: ${{ matrix.tool_slug }}-element-size-vs-stress-plot
135134
path: ${{ matrix.plot_filename }}
135+
136+
- name: Upload ${{ matrix.software_name }} aggregate RO-Crate artifact
137+
uses: actions/upload-artifact@v4
138+
with:
139+
name: ${{ matrix.tool_slug }}-aggregate-rocrate
140+
path: ${{ matrix.rocrate_filename }}
141+
142+
- name: Upload ${{ matrix.software_name }} RO-Crate Zip file onto RoHub
143+
id: rohub_upload
144+
shell: bash -l {0}
145+
continue-on-error: true
146+
run: |
147+
LOG_FILE="${GITHUB_WORKSPACE}/rohub_upload_${{ matrix.tool_slug }}_error.log"
148+
149+
OUTPUT="$(
150+
python benchmarks/common/upload_provenance.py \
151+
--provenance_folderpath "./${{ matrix.rocrate_filename }}" \
152+
--benchmark_name "linear-elastic-plate-with-hole-${{ matrix.tool_slug }}" \
153+
--username "${{ secrets.ROHUB_USERNAME }}" \
154+
--password "${{ secrets.ROHUB_PASSWORD }}" \
155+
2>&1
156+
)"
157+
PYTHON_EXIT_CODE=$?
158+
159+
if [ "$PYTHON_EXIT_CODE" -eq 0 ]; then
160+
echo "RoHub upload succeeded"
161+
rm -f "$LOG_FILE" || true
162+
else
163+
echo "=== RoHub upload failed, writing log to $LOG_FILE ==="
164+
printf '%s\n' "$OUTPUT" | tee "$LOG_FILE"
165+
fi
166+
167+
- name: Upload ${{ matrix.software_name }} RoHub error log
168+
if: always()
169+
uses: actions/upload-artifact@v4
170+
with:
171+
name: ${{ matrix.tool_slug }}-rohub-upload-error-log
172+
path: ${{ github.workspace }}/rohub_upload_${{ matrix.tool_slug }}_error.log
173+
if-no-files-found: ignore
136174

0 commit comments

Comments
 (0)