Skip to content

Commit

Permalink
Update test_r.yaml
Browse files Browse the repository at this point in the history
Try setting up env using reticulate instead of conda (since conda-incubator is currently restricted)
  • Loading branch information
jbousquin authored Jul 2, 2024
1 parent de53490 commit 4c6b60a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/test_r.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ jobs:
python-version: "3.9"
steps:
- uses: actions/checkout@v3
- name: Install/set-up conda
uses: conda-incubator/setup-miniconda@v3

- name: setup python
uses: actions/setup-python@v4
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
auto-activate-base: true
activate-environment: ""
python-version: ${{ matrix.config.python }}

- name: Set up R
uses: r-lib/actions/setup-r@v2
Expand All @@ -45,22 +42,25 @@ jobs:
#- uses: r-lib/actions/setup-renv@v2

- uses: r-lib/actions/setup-pandoc@v2

- name: Install testing pkgs
run: |
conda install pytest
conda install geopandas>=0.10.2, <0.13
conda install numpy<2.0
conda install pandas<2.0
conda install pint>=0.18
conda install dataretrieval>=1.0, <1.0.5
conda install requests

- name: Run env using R reticulate
- name: R depends
shell: Rscript {0}
run: |
install.packages(c("knitr", "rmarkdown", "reticulate"))
reticulate::import("harmonize_wq")
- name: setup r-reticulate venv
shell: Rscript {0}
run: |
library(reticulate)
path_to_venv <- virtualenv_create(
envname = "r-reticulate",
python = Sys.which("python"), # placed on PATH by the setup-python action
packages = c(
"pytest", "numpy<2.0", "pandas<2.0", "geopandas>=0.10.2, <0.13", "pint>=0.18",
"dataretrieval>=1.0, <1.0.5", "requests"
)
)
- name: Render-rmd
run: |
Expand Down

0 comments on commit 4c6b60a

Please sign in to comment.