Skip to content

Commit 3f15902

Browse files
committed
GH-CI: Fix finding libR.dylib on macos
Change-Id: I3320ddfbca364eb71e824ffd8f2010794c58663c
1 parent c015f74 commit 3f15902

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ jobs:
2525
with:
2626
r-version: ${{ matrix.r-version }}
2727
use-public-rspm: true
28-
cache-version: 2
29-
- name: Set env commands (POSIX)
30-
if: "!startsWith(matrix.os, 'windows')"
28+
- name: Set env commands (Linux)
29+
if: runner.os == 'Linux'
3130
run: |
3231
echo "VENV_ACTIVATE=source pyenv_base/bin/activate" >> $GITHUB_ENV
33-
echo "LD_LIBRARY_PATH=$(dirname $(find / -name libR.so)):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
32+
echo "LD_LIBRARY_PATH=$(dirname $(find / -name libR.so 2> /dev/null)):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
3433
echo "R_LIBRARY=export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
34+
- name: Set env commands (MacOS)
35+
if: "startsWith(matrix.os, 'macos')"
36+
run: |
37+
echo "VENV_ACTIVATE=source pyenv_base/bin/activate" >> $GITHUB_ENV
38+
echo "R_LIBRARY=$(find /Library -name libR.dylib 2> /dev/null | head -1)" >> $GITHUB_ENV
39+
echo "LD_LIBRARY_PATH=$(dirname ${R_LIBRARY}):${LD_LIBRARY_PATH}" >> $GITHUB_ENV
3540
- name: Set virtualenv activation command (Windows)
3641
if: startsWith(matrix.os, 'windows')
3742
shell: bash
@@ -96,7 +101,7 @@ jobs:
96101
- name: Test with pytest on POSIX
97102
if: runner.os != 'Windows'
98103
run: |
99-
export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}
104+
export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):$(dirname ${R_LIBRARY}):${LD_LIBRARY_PATH}
100105
python -m ensurepip --upgrade
101106
python -m pip install pytest
102107
pytest KorAPClient/tests --junitxml=junit/test-results-${{ matrix.python-version }}.xml

0 commit comments

Comments
 (0)