Skip to content

Commit 9572706

Browse files
committed
GH-CI: use pak to install RKorAPClient
This speeds up everything and ensures that dependencies are installed. Change-Id: I3e199b21ee3a218134d717e7d1f19312a9102efd
1 parent 3ae6b2c commit 9572706

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
max-parallel: 6
1111
fail-fast: false
1212
matrix:
13-
python-version: ['3.11', '3.12', '3.13']
13+
python-version: ['3.11', '3.13']
1414
r-version: [release]
1515
os: [macOS-latest, ubuntu-latest]
1616
steps:
@@ -26,6 +26,19 @@ jobs:
2626
r-version: ${{ matrix.r-version }}
2727
use-public-rspm: true
2828
cache-version: 2
29+
- name: Patch GHA issue with macos - Missing C library
30+
shell: bash
31+
run: |
32+
LIB_ARCHIVES=(\
33+
libdeflate-1.23-darwin.20-arm64.tar.xz \
34+
zstd-1.5.5-darwin.20-arm64.tar.xz \
35+
)
36+
for name in "${LIB_ARCHIVES[@]}"
37+
do
38+
curl -LO https://mac.r-project.org/bin/darwin20/arm64/"${name}"
39+
sudo tar xJf "${name}" -C /
40+
done
41+
if: runner.os == 'macOS'
2942
- name: Set up package maintainers R on Linux
3043
run: |
3144
sudo apt-get update -y
@@ -35,7 +48,9 @@ jobs:
3548
export R_LIBS_USER=/usr/local/lib/R/site-library
3649
if: runner.os == 'Linux'
3750
- name: Install R dependencies
38-
run: Rscript -e "install.packages('RKorAPClient')"
51+
run: |
52+
Rscript -e "install.packages('pak')"
53+
Rscript -e "pak::pak('RKorAPClient')"
3954
- name: Cache R packages on Linux
4055
uses: actions/cache@v3
4156
with:
@@ -51,13 +66,8 @@ jobs:
5166
- name: Install dependencies
5267
run: |
5368
python -m pip install --upgrade pip
54-
pip install wheel
55-
- name: Install package on Mac and Linux
56-
if: runner.os != 'Windows'
57-
run: |
58-
pip install .
59-
- name: Install package on Windows
60-
if: runner.os == 'Windows'
69+
pip install deflate wheel
70+
- name: Install package
6171
run: |
6272
pip install rpy2
6373
pip install .
@@ -69,7 +79,8 @@ jobs:
6979
if: runner.os != 'Windows'
7080
run: |
7181
export LD_LIBRARY_PATH=$(python -m rpy2.situation LD_LIBRARY_PATH):${LD_LIBRARY_PATH}
72-
pip install pytest
82+
python -m ensurepip --upgrade
83+
python -m pip install pytest
7384
pytest KorAPClient/tests --junitxml=junit/test-results-${{ matrix.python-version }}.xml
7485
- name: Test with pytest on Windows
7586
if: runner.os == 'Windows'
@@ -87,15 +98,15 @@ jobs:
8798
pdoc KorAPClient --force --html -o build/doc
8899
- name: Deploy documentation on Linux
89100
if: runner.os == 'Linux'
90-
uses: JamesIves/github-pages-deploy-action@releases/v3
101+
uses: JamesIves/github-pages-deploy-action@releases/v4
91102
with:
92103
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93104
BRANCH: gh-pages # The branch the action should deploy to.
94105
FOLDER: build/doc # The folder the action should deploy.
95106
TARGET_FOLDER: doc
96107
- name: Upload check results
97108
if: failure()
98-
uses: actions/upload-artifact@v3
109+
uses: actions/upload-artifact@v4
99110
with:
100111
name: pytest-results-${{ matrix.python-version }}
101112
path: junit/test-results-${{ matrix.python-version }}.xml

0 commit comments

Comments
 (0)