-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (72 loc) · 2.51 KB
/
hotfix_hotpatch.yaml
File metadata and controls
91 lines (72 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Hotfix hotpatch 🔥
on:
workflow_call:
secrets:
REPO_GITHUB_TOKEN:
description: Github token with read access to repositories
required: false
push:
branches:
- 'feature/hotfix-*'
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.2'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
CRAN: "https://packagemanager.posit.co/cran/2026-02-01"
steps:
- name: Checkout Hotfix Branch
uses: actions/checkout@v4
with:
path: hotfix_repo
- name: Checkout Junco v0.1.3
uses: actions/checkout@v4
with:
ref: refs/heads/v0.1.3
path: junco_source
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: false
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: junco_source
extra-packages: |
any::devtools
any::testthat
any::remotes
- name: Execute tests via hotpatchR
shell: Rscript {0}
run: |
message(">>> Installing Junco v0.1.3...")
devtools::install("junco_source", upgrade = FALSE, quick = TRUE)
message(">>> Installing hotpatchR ...")
devtools::install_github("munoztd0/hotpatchR", upgrade = "never")
library(hotpatchR)
apply_hotfix_file("hotfix_repo/dev/junco_hotfix_v0-1-3.R")
options(rgl.useNULL = TRUE)
Sys.setenv(NOT_CRAN = "true")
message(">>> Running tests against patched memory...")
reporter <- testthat::ListReporter$new()
# Setup environment
options(rgl.useNULL = TRUE)
Sys.setenv(NOT_CRAN = "true")
message(">>> Running devtools::test() with hotfix...")
res <- devtools::test('junco_source')
df <- as.data.frame(res)
total_fails <- sum(df$failed) + sum(df$error)
if (total_fails > 0) {
cat("\n❌ HOTFIX FAILED: Test failures detected.\n")
stop(sprintf("PIPELINE HALTED: %d tests failed or errored.", total_fails), call. = FALSE)
} else {
message("\n✅ SUCCESS: All tests passed. Hotfix is passing.")
}