Skip to content

Commit

Permalink
ci.yml: Make sure PATH persists between steps
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuacwnewton authored Jul 18, 2024
1 parent 56b375f commit 0719401
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ jobs:
git clone https://github.com/spinalcordtoolbox/spinalcordtoolbox.git
cd spinalcordtoolbox
./.ci.sh -i
export PATH="$PWD/spinalcordtoolbox/bin:$PATH"
# NB: install_sct edits ~/.bashrc, but those environment changes don't get passed to subsequent steps in GH Actions.
# So, we filter through the .bashrc and pass the values to $GITHUB_ENV and $GITHUB_PATH.
# Relevant documentation: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#environment-files
cat ~/.bashrc | grep "export SCT_DIR" | cut -d " " -f 2 >> $GITHUB_ENV
cat ~/.bashrc | grep "export PATH" | grep -o "/.*" | cut -d ':' -f 1 >> $GITHUB_PATH
- name: Run tests with pytest
run: |
Expand Down

0 comments on commit 0719401

Please sign in to comment.