Skip to content

Commit aff144b

Browse files
Automatically upload CSV files as artifacts during CI runs (#31)
1 parent dc50cda commit aff144b

2 files changed

Lines changed: 28 additions & 8 deletions

File tree

.github/workflows/run_batch_script.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ jobs:
4040
cat ~/.bashrc | grep "export SCT_DIR" | cut -d " " -f 2 >> $GITHUB_ENV
4141
cat ~/.bashrc | grep "export PATH" | grep -o "/.*" | cut -d ':' -f 1 >> $GITHUB_PATH
4242
43+
- name: Pre-download necessary models
44+
run: |
45+
sct_deepseg spinalcord -install
46+
4347
- name: "Checkout '${{ github.event.repository.name }}'"
4448
uses: actions/checkout@v4
4549
with:
@@ -50,17 +54,27 @@ jobs:
5054
cd "${{ github.event.repository.name }}/multi_subject"
5155
sct_run_batch -script process_data.sh -config config.yml
5256
57+
- name: "Upload CSV files for easier tutorial updating"
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: Multi Subject CSV Files
61+
path: ${{ github.event.repository.name }}/multi_subject/output/**/*.csv
62+
5363
- name: Output full log for sanity checking
64+
if: always()
5465
run: |
5566
cd "${{ github.event.repository.name }}/multi_subject/output/log"
56-
for logfile in process_data_sub-01.log err.process_data_sub-01.log; do
57-
if [[ -e "${logfile}" ]]; then
58-
echo "=== Contents of ${logfile} ==="
59-
cat "${logfile}"
60-
else
61-
echo "=== No file ${logfile} ==="
62-
fi
63-
done
67+
for subxx in sub-01 sub-03 sub-05; do
68+
for logfile in process_data_${subxx}.log err.process_data_${subxx}.log; do
69+
if [[ -e "${logfile}" ]]; then
70+
echo "=== Contents of ${logfile} ==="
71+
cat "${logfile}"
72+
else
73+
echo "=== No file ${logfile} ==="
74+
fi
75+
done
76+
done
77+
6478
6579
- name: Check results (no error logs)
6680
if: always()

.github/workflows/run_script_and_create_release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ jobs:
6060
cd "${{ github.event.repository.name }}/single_subject"
6161
./batch_single_subject.sh
6262
63+
- name: "Upload CSV files for easier tutorial updating"
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: Single Subject CSV Files
67+
path: ${{ github.event.repository.name }}/single_subject/data/**/*.csv
68+
6369
- name: "Package data into tutorial-specific .zip files"
6470
run: |
6571
cd ${{ github.event.repository.name }}

0 commit comments

Comments
 (0)