Skip to content

Commit a4cf3a7

Browse files
Update to align with V6.3.5 dev changes
Update to align with V6.3.5 dev changes
2 parents 195e4b5 + 3563df7 commit a4cf3a7

365 files changed

Lines changed: 3513 additions & 54897 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.Rbuildignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@
77
^data$
88
^docs$
99
^pkgdown$
10+
^\.circleci$
11+
^\.circleci/config\.yml$
12+
^\.github$
13+
^cran-comments\.md$

.circleci/config.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright (c) 2024 Arjuna Technologies, Newcastle upon Tyne. All rights reserved.
2+
3+
version: 2.1
4+
5+
jobs:
6+
dsbase:
7+
docker:
8+
- image: cimg/base:current
9+
resource_class: small
10+
steps:
11+
- checkout
12+
- setup_remote_docker:
13+
docker_layout_caching: true
14+
- run: |
15+
echo "Building"
16+
echo " Repo Name: " $CIRCLE_PROJECT_REPONAME
17+
echo " Branch: " $CIRCLE_BRANCH
18+
echo " Tag: " $CIRCLE_TAG
19+
- run:
20+
command: |
21+
sudo apt-get update -y
22+
sudo apt-get install -y r-base-core cmake
23+
- run:
24+
command: |
25+
sudo apt-get install -y libxml2-dev
26+
- run:
27+
command: |
28+
echo "options(Ncpus=4)" >> ~/.Rprofile
29+
sudo Rscript -e "install.packages('RANN', dependencies=TRUE)"
30+
sudo Rscript -e "install.packages('stringr', dependencies=TRUE)"
31+
sudo Rscript -e "install.packages('lme4', dependencies=TRUE)"
32+
sudo Rscript -e "install.packages('dplyr', dependencies=TRUE)"
33+
sudo Rscript -e "install.packages('reshape2', dependencies=TRUE)"
34+
sudo Rscript -e "install.packages('polycor', dependencies=TRUE)"
35+
sudo Rscript -e "install.packages('splines', dependencies=TRUE)"
36+
sudo Rscript -e "install.packages('gamlss', dependencies=TRUE)"
37+
sudo Rscript -e "install.packages('gamlss.dist', dependencies=TRUE)"
38+
sudo Rscript -e "install.packages('mice', dependencies=TRUE)"
39+
sudo Rscript -e "install.packages('childsds', dependencies=TRUE)"
40+
sudo Rscript -e "install.packages('xml2', dependencies=TRUE)"
41+
sudo Rscript -e "install.packages('covr', dependencies=TRUE)"
42+
sudo Rscript -e "install.packages('devtools', dependencies=TRUE)"
43+
sudo Rscript -e "install.packages('DSI', dependencies=TRUE)"
44+
sudo Rscript -e "install.packages('DSLite', dependencies=TRUE)"
45+
- run:
46+
command: |
47+
sudo Rscript -e 'library(covr); covr::codecov(token = "'$CODECOV_TOKEN'")'
48+
workflows:
49+
build:
50+
jobs:
51+
- dsbase

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
config:
22+
- {os: macos-latest, r: 'release'}
23+
- {os: windows-latest, r: 'release'}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
27+
28+
env:
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'
Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
################################################################################
2+
# DataSHIELD GHA test suite - dsBase
3+
# Adapted from `azure-pipelines.yml` by Roberto Villegas-Diaz
4+
#
5+
# Inside the root directory $(Pipeline.Workspace) will be a file tree like:
6+
# /dsBase <- Checked out version of datashield/dsBase
7+
# /dsBase/logs <- Where results of tests and logs are collated
8+
# /testStatus <- Checked out version of datashield/testStatus
9+
#
10+
# As of Jul 2025 this takes ~ 9 mins to run.
11+
################################################################################
12+
name: dsBase tests' suite
13+
14+
on:
15+
push:
16+
schedule:
17+
- cron: '0 0 * * 0' # Weekly
18+
- cron: '0 1 * * *' # Nightly
19+
20+
jobs:
21+
dsBase_test_suite:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 120
24+
permissions:
25+
contents: write
26+
27+
# These should all be constant, except TEST_FILTER. This can be used to test
28+
# subsets of test files in the testthat directory. Options are like:
29+
# '*' <- Run all tests.
30+
# 'asNumericDS*' <- Run all asNumericDS tests, i.e. all the arg, etc. tests.
31+
# '*_smk_*' <- Run all the smoke tests for all functions.
32+
env:
33+
TEST_FILTER: '*'
34+
_r_check_system_clock_: 0
35+
WORKFLOW_ID: ${{ github.run_id }}-${{ github.run_attempt }}
36+
PROJECT_NAME: dsBase
37+
BRANCH_NAME: ${{ github.ref_name }}
38+
REPO_OWNER: ${{ github.repository_owner }}
39+
R_KEEP_PKG_SOURCE: yes
40+
GITHUB_TOKEN: ${{ github.token || 'placeholder-token' }}
41+
42+
steps:
43+
- name: Checkout dsBase
44+
uses: actions/checkout@v4
45+
with:
46+
path: dsBase
47+
48+
- name: Checkout testStatus
49+
if: ${{ github.actor != 'nektos/act' }} # for local deployment only
50+
uses: actions/checkout@v4
51+
with:
52+
repository: ${{ env.REPO_OWNER }}/testStatus
53+
ref: master
54+
path: testStatus
55+
persist-credentials: false
56+
token: ${{ env.GITHUB_TOKEN }}
57+
58+
- uses: r-lib/actions/setup-pandoc@v2
59+
60+
- uses: r-lib/actions/setup-r@v2
61+
with:
62+
r-version: release
63+
http-user-agent: release
64+
use-public-rspm: true
65+
66+
- name: Install dsBase
67+
run: |
68+
Rscript -e 'install.packages(c("RANN", "stringr", "lme4", "dplyr", "reshape2", "polycor", "gamlss", "gamlss.dist", "mice", "childsds", "usethis", "devtools"), dependencies = TRUE)'
69+
R CMD INSTALL ./dsBase
70+
71+
- uses: r-lib/actions/setup-r-dependencies@v2
72+
with:
73+
dependencies: 'c("Imports")'
74+
extra-packages: |
75+
any::rcmdcheck
76+
cran::devtools
77+
cran::git2r
78+
cran::RCurl
79+
cran::readr
80+
cran::magrittr
81+
cran::xml2
82+
cran::purrr
83+
cran::dplyr
84+
cran::stringr
85+
cran::tidyr
86+
cran::quarto
87+
cran::knitr
88+
cran::kableExtra
89+
cran::rmarkdown
90+
cran::downlit
91+
needs: check
92+
93+
- name: Check man files up-to-date
94+
run: |
95+
orig_sum=$(find man -type f | sort -u | xargs cat | md5sum)
96+
R -e "devtools::document()"
97+
new_sum=$(find man -type f | sort -u | xargs cat | md5sum)
98+
if [ "$orig_sum" != "$new_sum" ]; then
99+
echo "Your committed manual files (man/*.Rd) are out of sync with the R files. Run devtools::document() locally then commit."
100+
exit 1
101+
else
102+
echo "Documentation up-to-date."
103+
fi
104+
working-directory: dsBase
105+
continue-on-error: true
106+
107+
- name: Run devtools::check
108+
run: |
109+
R -q -e "library('devtools'); devtools::check(args = c('--no-tests', '--no-examples'))" | tee ../check.Rout
110+
grep -q "^0 errors" ../check.Rout && grep -q " 0 warnings" ../check.Rout && grep -q " 0 notes" ../check.Rout
111+
working-directory: dsBase
112+
continue-on-error: true
113+
114+
- name: Run tests with coverage & JUnit report
115+
run: |
116+
mkdir -p logs
117+
R -q -e "devtools::reload();"
118+
R -q -e '
119+
write.csv(
120+
covr::coverage_to_list(
121+
covr::package_coverage(
122+
type = c("none"),
123+
code = c('"'"'
124+
output_file <- file("test_console_output.txt");
125+
sink(output_file);
126+
sink(output_file, type = "message");
127+
junit_rep <- testthat::JunitReporter$new(file = file.path(getwd(), "test_results.xml"));
128+
progress_rep <- testthat::ProgressReporter$new(max_failures = 999999);
129+
multi_rep <- testthat::MultiReporter$new(reporters = list(progress_rep, junit_rep));
130+
testthat::test_package("${{ env.PROJECT_NAME }}", filter = "${{ env.TEST_FILTER }}", reporter = multi_rep, stop_on_failure = FALSE)'"'"'
131+
)
132+
)
133+
),
134+
"coveragelist.csv"
135+
)'
136+
137+
mv coveragelist.csv logs/
138+
mv test_* logs/
139+
grep -q " FAIL 0 " logs/test_console_output.txt
140+
working-directory: dsBase
141+
142+
- name: Check for JUnit errors
143+
run: |
144+
issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep -c errors= || true)
145+
echo "Number of testsuites with issues: $issue_count"
146+
sed 's/failures="0" errors="0"//' test_results.xml | grep errors= > issues.log || true
147+
cat issues.log || true
148+
exit $issue_count
149+
working-directory: dsBase/logs
150+
151+
- name: Write versions to file
152+
run: |
153+
echo "branch:${{ env.BRANCH_NAME }}" > ${{ env.WORKFLOW_ID }}.txt
154+
echo "os:$(lsb_release -ds)" >> ${{ env.WORKFLOW_ID }}.txt
155+
echo "R:$(R --version | head -n1)" >> ${{ env.WORKFLOW_ID }}.txt
156+
working-directory: dsBase/logs
157+
158+
- name: Parse results from testthat and covr
159+
run: |
160+
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/
161+
working-directory: dsBase
162+
163+
- name: Render report
164+
run: |
165+
cd testStatus
166+
167+
mkdir -p new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
168+
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
169+
mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/
170+
171+
# Copy logs to new logs directory location
172+
cp -rv ../${{ env.PROJECT_NAME }}/logs/* new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
173+
cp -rv ../${{ env.PROJECT_NAME }}/logs/${{ env.WORKFLOW_ID }}.txt new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
174+
175+
R -e 'input_dir <- file.path("../new/logs", Sys.getenv("PROJECT_NAME"), Sys.getenv("BRANCH_NAME"), Sys.getenv("WORKFLOW_ID")); quarto::quarto_render("source/test_report.qmd", execute_params = list(input_dir = input_dir))'
176+
mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
177+
cp -r new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest
178+
179+
env:
180+
PROJECT_NAME: ${{ env.PROJECT_NAME }}
181+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
182+
WORKFLOW_ID: ${{ env.WORKFLOW_ID }}
183+
184+
- name: Upload test logs
185+
uses: actions/upload-artifact@v4
186+
with:
187+
name: dsbase-logs
188+
path: testStatus/new
189+
190+
- name: Dump environment info
191+
run: |
192+
echo -e "\n#############################"
193+
echo -e "ls /: ######################"
194+
ls -al .
195+
echo -e "\n#############################"
196+
echo -e "lscpu: ######################"
197+
lscpu
198+
echo -e "\n#############################"
199+
echo -e "memory: #####################"
200+
free -m
201+
echo -e "\n#############################"
202+
echo -e "env: ########################"
203+
env
204+
echo -e "\n#############################"
205+
echo -e "R sessionInfo(): ############"
206+
R -e 'sessionInfo()'
207+
sudo apt install tree -y
208+
tree .
209+

.github/workflows/pkgdown.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
10+
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
pkgdown:
17+
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
21+
env:
22+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: r-lib/actions/setup-pandoc@v2
29+
30+
- uses: r-lib/actions/setup-r@v2
31+
with:
32+
use-public-rspm: true
33+
34+
- uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::pkgdown, local::.
37+
needs: website
38+
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
shell: Rscript {0}
42+
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs

0 commit comments

Comments
 (0)