diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index 12cde4bd..00000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,93 +0,0 @@ -# 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() - shell: Rscript {0} - - - name: Check installed packages - run: installed.packages() - shell: Rscript {0} - - - name: Install testthat (if needed) - run: | - if(!requireNamespace("testthat", quietly = TRUE)) 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 flair torch - shell: bash - - - name: Set Python Path for R reticulate - run: | - echo "RETICULATE_PYTHON=${{ github.workspace }}/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 ${{ github.workspace }}/flair_env/bin - shell: bash - - - name: Run R tests with detailed logging - run: | - source flair_env/bin/activate - Rscript -e 'reticulate::use_virtualenv("${{ github.workspace }}/flair_env", required = TRUE)' - Rscript -e 'testthat::test_dir("tests/testthat")' - shell: bash - - - name: Check renv status (debug step) - run: renv::status() - shell: Rscript {0} - - - name: Run Test Coverage - run: | - source flair_env/bin/activate - Rscript -e 'reticulate::use_virtualenv("${{ github.workspace }}/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 ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - env: - R_LIBS_USER: ${{ runner.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 diff --git a/README.Rmd b/README.Rmd index 56f256db..4240bc9f 100644 --- a/README.Rmd +++ b/README.Rmd @@ -9,7 +9,7 @@ output: github_document [![R-Windows](https://github.com/davidycliao/flaiR/actions/workflows/r_window.yml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/r_window.yml) [![R-CMD-Check](https://github.com/davidycliao/flaiR/actions/workflows/r.yml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/r.yml) -[![coverage](https://github.com/davidycliao/flaiR/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/test-coverage.yaml) + [![codecov](https://codecov.io/gh/davidycliao/flaiR/graph/badge.svg?token=CPIBIB6L78)](https://codecov.io/gh/davidycliao/flaiR) [![CodeFactor](https://www.codefactor.io/repository/github/davidycliao/flair/badge)](https://www.codefactor.io/repository/github/davidycliao/flair) diff --git a/README.md b/README.md index 3a2bd8c9..00ca9e31 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![R-Windows](https://github.com/davidycliao/flaiR/actions/workflows/r_window.yml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/r_window.yml) [![R-CMD-Check](https://github.com/davidycliao/flaiR/actions/workflows/r.yml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/r.yml) -[![coverage](https://github.com/davidycliao/flaiR/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/davidycliao/flaiR/actions/workflows/test-coverage.yaml) + [![codecov](https://codecov.io/gh/davidycliao/flaiR/graph/badge.svg?token=CPIBIB6L78)](https://codecov.io/gh/davidycliao/flaiR) [![CodeFactor](https://www.codefactor.io/repository/github/davidycliao/flair/badge)](https://www.codefactor.io/repository/github/davidycliao/flair)