Skip to content

Commit a9530f4

Browse files
committed
ci: improve R setup and synchronize the workflow definitions
1 parent 3083f32 commit a9530f4

3 files changed

Lines changed: 33 additions & 42 deletions

File tree

.github/workflows/deploy-book-python-and-r.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy book with Python and R
1+
name: Deploy book with Python, SPARQL, and R
22

33
on:
44
workflow_run:
@@ -21,10 +21,7 @@ jobs:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323

24-
- name: Install libcurl for R pak
25-
run: |
26-
sudo apt-get install -y --no-install-recommends libcurl4-openssl-dev
27-
24+
# Python
2825
- name: Set up Python 3.11
2926
uses: actions/setup-python@v5
3027
with:
@@ -34,32 +31,28 @@ jobs:
3431
- name: Install Python dependencies
3532
run: |
3633
pip install -r requirements.txt
37-
34+
35+
36+
# R
3837
- name: Set up R
3938
uses: r-lib/actions/setup-r@v2
4039

41-
- name: Cacheing for R packages
42-
uses: actions/cache@v3
40+
- name: install R dependencies
41+
uses: r-lib/actions/setup-r-dependencies@v2
4342
with:
44-
path: ${{ env.R_LIBS_USER }}
45-
key: ${{ runner.os }}-r-${{ hashFiles('**/install_dependencies.R') }}
46-
restore-keys: ${{ runner.os }}-r-
43+
cache: true
44+
cache-version: 2
45+
extra-packages:
46+
tidyverse
47+
IRkernel
4748

48-
- name: Install pak
49+
- name: Set up IRkernel
4950
run: |
50-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/")
51-
shell: Rscript {0}
52-
53-
- name: Install IRkernel and set it up
54-
run: |
55-
pak::pkg_install("IRkernel")
5651
IRkernel::installspec(name="ir", displayname="R")
5752
shell: Rscript {0}
5853

59-
- name: Install R_requirements
60-
run: |
61-
Rscript install_dependencies.R
6254

55+
# check all kernels
6356
- name: Log all available kernels
6457
run: |
6558
jupyter kernelspec list

.github/workflows/deploy-book-python-only.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy book with Python
1+
name: Deploy book with Python, SPARQL, and R
22

33
on:
44
workflow_run:
@@ -21,6 +21,7 @@ jobs:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323

24+
# Python
2425
- name: Set up Python 3.11
2526
uses: actions/setup-python@v5
2627
with:
@@ -30,7 +31,9 @@ jobs:
3031
- name: Install Python dependencies
3132
run: |
3233
pip install -r requirements.txt
34+
3335

36+
# check all kernels
3437
- name: Log all available kernels
3538
run: |
3639
jupyter kernelspec list

.github/workflows/deploy-book-python-sparql-r.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ jobs:
2121
- name: Checkout repository
2222
uses: actions/checkout@v4
2323

24-
- name: Install libcurl for R pak
25-
run: |
26-
sudo apt-get install -y --no-install-recommends libcurl4-openssl-dev
27-
24+
# Python
2825
- name: Set up Python 3.11
2926
uses: actions/setup-python@v5
3027
with:
@@ -34,36 +31,34 @@ jobs:
3431
- name: Install Python dependencies
3532
run: |
3633
pip install -r requirements.txt
37-
34+
35+
36+
# R
3837
- name: Set up R
3938
uses: r-lib/actions/setup-r@v2
4039

41-
- name: Cacheing for R packages
42-
uses: actions/cache@v3
40+
- name: install R dependencies
41+
uses: r-lib/actions/setup-r-dependencies@v2
4342
with:
44-
path: ${{ env.R_LIBS_USER }}
45-
key: ${{ runner.os }}-r-${{ hashFiles('**/install_dependencies.R') }}
46-
restore-keys: ${{ runner.os }}-r-
43+
cache: true
44+
cache-version: 2
45+
extra-packages:
46+
tidyverse
47+
IRkernel
4748

48-
- name: Install pak
49+
- name: Set up IRkernel
4950
run: |
50-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/devel/")
51-
shell: Rscript {0}
52-
53-
- name: Install IRkernel and set it up
54-
run: |
55-
pak::pkg_install("IRkernel")
5651
IRkernel::installspec(name="ir", displayname="R")
5752
shell: Rscript {0}
5853

59-
- name: Install R_requirements
60-
run: |
61-
Rscript install_dependencies.R
6254

55+
# SPARQL
6356
- name: Install SPARQL kernel
6457
run: |
6558
jupyter sparqlkernel install --user
6659
60+
61+
# check all kernels
6762
- name: Log all available kernels
6863
run: |
6964
jupyter kernelspec list

0 commit comments

Comments
 (0)