Skip to content
Closed
10 changes: 3 additions & 7 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@ pkgdown
^cran-comments\.md$
^\.covrignore$
^\.idea$
^lint_results.txt$

# output
^\.vscode$
^air\.toml$
^output$
^junco_tlg_template_scripts$
^[^/]*\.R$
^\.vscode$
^[.]?air[.]toml$
^CHANGELOG\.md$
^air\.toml$
^dev$
83 changes: 83 additions & 0 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Hotfix Tests

on:
push:
branches:
- 'feature/hotfix-*'
pull_request:
branches: [main, CRAN]
workflow_dispatch:

jobs:
test-hotfix:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: '4.5.0'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::devtools
any::testthat

- name: Install Local Junco
shell: Rscript {0}
run: |
devtools::install(".", upgrade = FALSE, quick = TRUE)

- name: Execute tests with hotfixes
shell: Rscript {0}
run: |
project_root <- getwd()
hotfix_file <- file.path(project_root, "dev", "junco_hotfix.R")

devtools::load_all(project_root)

# Inject the Hotfix
if (file.exists(hotfix_file)) {
message(">>> Injecting Hotfix: ", hotfix_file)
source(hotfix_file, local = FALSE)
} else {
stop("Hotfix file not found at ", hotfix_file)
}

# Run tests in the current environment
library(testthat)
options(rgl.useNULL = TRUE)
options(testthat.progress.max_reports = 10)
testthat::set_max_fails(Inf)

reporter <- testthat::ListReporter$new()
try({
testthat::test_dir("tests/testthat", reporter = reporter)
}, silent = FALSE)
results <- reporter$get_results()

# Exit with error code if any tests failed
if (!testthat:::all_passed(results)) {
stop("Tests failed with the current hotfix applied.")
}



2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Authors@R: c(
person("Paul", "Jenkins", , "pjenkin2@its.jnj.com", role = c("aut")),
person("Daniel", "Hofstaedter", , "dhofstae@its.jnj.com", role = c("aut")),
person("Joseph", "Kovach", , "jkovach2@its.jnj.com", role = c("aut")),
person("David", "Munoz Tord", , "david.munoztord@mailbox.com", role = c("aut")),
person("David", "Munoz Tord", , "david.munoztord@mailbox.org", role = c("aut")),
person("Daniel", "Sabanes Bove", , "daniel@rconis.com", role = c("aut")),
person("Ezequiel", "Anokian", , "eanokia1@its.jnj.com", role = c("ctb")),
person("Renfei", "Mao", , "rmao6@its.jnj.com", role = c("ctb")),
Expand Down
Loading
Loading