Skip to content

Commit

Permalink
62 r test ci (#86)
Browse files Browse the repository at this point in the history
Update test_r.yaml to install conda outside r, specifically miniforge, then run on env from setup with current package (vs pip installing main)
  • Loading branch information
jbousquin authored Jul 23, 2024
1 parent 812d60f commit f4f53b7
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions .github/workflows/test_r.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: R-test
on:
push:
branches:
[main, dev]
[main]
pull_request:
branches:
[main]
Expand All @@ -23,13 +23,31 @@ jobs:
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v4

- name: setup python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-version: 'latest'

- name: Conda install
shell: bash -el {0}
run: |
# conda deactivate
# conda rename -n test wq_harmonize
conda install "pytest" "numpy<2.0" "pandas<2.0" "geopandas>=0.10.2, <0.13" "pint>=0.18" "dataretrieval>=1.0, <1.0.5" "requests"
conda install pip
pip install .
conda create --name wq_harmonize --clone test
- name: Print Conda environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Set up R
uses: r-lib/actions/setup-r@v2
Expand All @@ -50,23 +68,24 @@ jobs:
run: |
library(reticulate)
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"
)
# 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"
# )
reticulate::install_miniconda()
reticulate::conda_create("wq_harmonize", python_version = "${{ matrix.python-version }}")
reticulate::conda_install("wq_harmonize", packages)
# reticulate::install_miniconda()
# reticulate::conda_create("wq_harmonize", python_version = "${{ matrix.python-version }}")
# reticulate::conda_install("wq_harmonize", packages)
#path_to_venv <- virtualenv_create(
# path_to_venv <- virtualenv_create(
# envname = "wq_harmonize",
# python = Sys.which("python"), # placed on PATH by the setup-python action
# packages
#)
#use_virtualenv("wq_harmonize")
# )
# use_virtualenv("wq_harmonize")
reticulate::py_install("git+https://github.com/USEPA/harmonize-wq.git", pip = TRUE, envname = "wq_harmonize")
reticulate::use_condaenv("wq_harmonize")
#reticulate::py_install("git+https://github.com/USEPA/harmonize-wq.git", pip = TRUE, envname = "wq_harmonize")
rmarkdown::render(input = "demos/Harmonize_Pensacola.Rmd")
Expand Down

0 comments on commit f4f53b7

Please sign in to comment.