Skip to content

Commit

Permalink
Update mac_r.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
davidycliao committed Aug 19, 2024
1 parent 3cca394 commit f3980fa
Showing 1 changed file with 1 addition and 42 deletions.
43 changes: 1 addition & 42 deletions .github/workflows/mac_r.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,48 +34,6 @@ jobs:
brew install gcc
shell: bash

- name: Check for gfortran in common paths
run: |
if [ -x "/opt/homebrew/bin/gfortran" ]; then
echo "Found gfortran in /opt/homebrew/bin"
elif [ -x "/usr/local/bin/gfortran" ]; then
echo "Found gfortran in /usr/local/bin"
elif [ -x "/opt/homebrew/opt/gcc/bin/gfortran" ]; then
echo "Found gfortran in /opt/homebrew/opt/gcc/bin"
echo "/opt/homebrew/opt/gcc/bin" >> $GITHUB_PATH
else
echo "gfortran not found"
exit 1
fi
shell: bash

- name: Adjust gfortran library paths
run: |
if [ -d "/opt/homebrew/opt/gcc" ]; then
sudo mkdir -p /opt/R/arm64/gfortran/lib/gcc
sudo ln -sf /opt/homebrew/opt/gcc/lib/gcc /opt/R/arm64/gfortran/lib/gcc
sudo ln -sf /opt/homebrew/opt/gcc/lib /opt/R/arm64/gfortran/lib
fi
shell: bash

- name: Add Rscript to PATH
run: |
if [ -x "/Library/Frameworks/R.framework/Resources/bin/Rscript" ]; then
echo "/Library/Frameworks/R.framework/Resources/bin" >> $GITHUB_PATH
elif [ -x "/usr/local/bin/Rscript" ]; then
echo "/usr/local/bin" >> $GITHUB_PATH
else
echo "Rscript not found, exiting."
exit 1
fi
shell: bash

- name: Verify Rscript is available
run: |
which Rscript
Rscript --version
shell: bash

- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
Expand Down Expand Up @@ -121,3 +79,4 @@ jobs:
NOT_CRAN: true



0 comments on commit f3980fa

Please sign in to comment.