Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/run_script_and_create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ on:
description: 'Release title (e.g. rYYYYMMDD)'
required: true

env:
# Hardcoding this variable just to make accessing the output files a bit simpler (for testing)
# See: https://github.com/spinalcordtoolbox/sct_tutorial_data/actions/runs/28119017640/job/83265838588?pr=35#step:3:43
# Also: https://github.com/orgs/community/discussions/25576#discussioncomment-3248364
SCT_DIR: "${{ github.workspace }}/spinalcordtoolbox"

jobs:
run-course-script:
runs-on: ubuntu-latest
Expand All @@ -34,6 +40,7 @@ jobs:
- name: Checkout spinalcordtoolbox
uses: actions/checkout@v4
with:
ref: jn/3508-merge-example-datasets-and-batch-scripts
repository: spinalcordtoolbox/spinalcordtoolbox
path: spinalcordtoolbox

Expand All @@ -56,6 +63,9 @@ jobs:
path: ${{ github.event.repository.name }}

- name: Run batch_single_subject.sh to generate intermediate files
# NB: SCT's copy of batch_single_subject.sh is standalone and cds into SCT_DIR
# So, even though we run the script here, the output files will be generated elsewhere
# This is just temporary for testing purposes, so don't commit these changes.
run: |
cd "${{ github.event.repository.name }}/single_subject"
./batch_single_subject.sh
Expand All @@ -70,11 +80,11 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Single Subject CSV Files
path: ${{ github.event.repository.name }}/single_subject/data/**/*.csv
path: ${{ env.SCT_DIR }}/data/sct_course_data/single_subject/data/**/*.csv

- name: "Package data into tutorial-specific .zip files"
run: |
cd ${{ github.event.repository.name }}
cd "${{ env.SCT_DIR }}/data/sct_course_data/"
awk -F, '{ print $1,$2 }' tutorial-datasets.csv | xargs -l zip -ur

- uses: ncipollo/release-action@v1
Expand All @@ -92,7 +102,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "${{ github.event.repository.name }}/*.zip"
file: "${{ env.SCT_DIR }}/data/sct_course_data/*.zip"
draft: false
tag_name: ${{ github.event.inputs.release_title }}
release_id: ${{ steps.create_release.outputs.id }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/process_csvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def process_ap_ratio_norm_pam50(ci_root: Path, tutorials_root: Path) -> None:
def process_csa_c3c4(ci_root: Path, tutorials_root: Path) -> None:
out = tutorials_root / "shape-analysis/compute-csa-and-other-shape-metrics"
process(
ci_root / "t2/csa_c3c4.csv",
out / "csa_c3c4.csv",
ci_root / "t2/csa_c2c3.csv",
out / "csa_c2c3.csv",
keep_cols=["Filename", "Slice (I->S)", "VertLevel", "MEAN(area)", "STD(area)"],
conditional_vertlevel=True,
)
Expand Down
Loading
Loading