Skip to content

Merge pull request #174 from davidycliao/dependabot/pip/contourpy-1.3.0 #1131

Merge pull request #174 from davidycliao/dependabot/pip/contourpy-1.3.0

Merge pull request #174 from davidycliao/dependabot/pip/contourpy-1.3.0 #1131

# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
name: R-Python Integration and Test Coverage
on: [push, pull_request]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.2'
- name: Install R dependencies and Restore R environment
run: |
install.packages('renv')
renv::restore()
renv::install('covr')
shell: Rscript {0}
- name: Install testthat package
run: Rscript -e 'install.packages("testthat")'
shell: Rscript {0}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10.x'
- name: Create Python virtual environment using venv
run: python -m venv flair_env
- name: Install Python dependencies in virtual environment
run: |
source flair_env/bin/activate
pip install scipy==1.12.0
pip install flair
pip install torch
- name: Set Python Path for R reticulate
run: |
echo "RETICULATE_PYTHON=$(pwd)/flair_env/bin/python" >> $GITHUB_ENV
shell: bash
- name: Print RETICULATE_PYTHON value
run: echo "RETICULATE_PYTHON=$RETICULATE_PYTHON"
shell: bash
- name: Check Python virtual environment structure
run: |
ls -l $(pwd)/flair_env/bin
shell: bash
- name: Run R tests with detailed logging
run: |
source flair_env/bin/activate
Rscript -e 'reticulate::use_virtualenv("$(pwd)/flair_env", required = TRUE)'
Rscript -e 'testthat::test_dir("tests/testthat")'
shell: bash
- name: Check renv status (debug step)
run: Rscript -e 'renv::status()'
shell: Rscript {0}
- name: Run Test Coverage
run: |
source flair_env/bin/activate
Rscript -e 'reticulate::use_virtualenv("$(pwd)/flair_env", required = TRUE)'
Rscript -e 'covr::codecov(quiet = FALSE, clean = FALSE, install_path = file.path(Sys.getenv("RUNNER_TEMP"), "flaiR"))'
shell: bash
- name: Show testthat output
if: always()
run: |
find /home/runner/work/_temp/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash
env:
R_LIBS_USER: /home/runner/work/_temp/Library
TZ: UTC
_R_CHECK_SYSTEM_CLOCK_: FALSE
NOT_CRAN: true
pythonLocation: /opt/hostedtoolcache/Python/3.10.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.10.15/x64/lib
RETICULATE_PYTHON: /home/runner/work/flaiR/flaiR/flair_env/bin/python