Skip to content

Commit

Permalink
UPDATE: cicd workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaob1201 committed Nov 5, 2024
1 parent 51b9874 commit dced658
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/r-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ jobs:

- name: Install dependencies
run: |
if [ -f "install_dependencies.R" ]; then
Rscript install_dependencies.R
else
echo "No install_dependencies.R found, skipping..."
fi
Rscript -e 'if (!requireNamespace("testthat", quietly = TRUE)) install.packages("testthat")'
# Install testthat and here packages if not already installed
Rscript -e 'packages <- c("testthat", "here"); needed <- packages[!packages %in% installed.packages()]; if(length(needed)) install.packages(needed)'
- name: Run tests with testthat
run: |
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-logit_functions.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
install.packages("testthat")

library(testthat)
library(here) # Use here for flexible paths if needed
library(here)
source(here("R", "logit_functions.R"))

source(here("R/logit_functions.R")) # Ensure this path correctly points to the functions you want to test
#source("R/logit_functions.R") # Ensure this path correctly points to the functions you want to test

test_that("logistic function returns probabilities between 0 and 1", {
expect_true(all(logistic(c(-5, 0, 5)) >= 0 & logistic(c(-5, 0, 5)) <= 1))
Expand Down

0 comments on commit dced658

Please sign in to comment.