Skip to content

Commit ea12b73

Browse files
Update to 6.3.4
Update to 6.3.4
2 parents fd1149e + 67ba65a commit ea12b73

211 files changed

Lines changed: 1566 additions & 595 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.
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
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+
41+
steps:
42+
- name: Checkout dsBase
43+
uses: actions/checkout@v4
44+
with:
45+
path: dsBase
46+
47+
- name: Checkout testStatus
48+
uses: actions/checkout@v4
49+
with:
50+
repository: ${{ env.REPO_OWNER }}/testStatus
51+
token: ${{ secrets.GH_TOKEN }}
52+
ref: master
53+
path: testStatus
54+
55+
- uses: r-lib/actions/setup-pandoc@v2
56+
57+
- uses: r-lib/actions/setup-r@v2
58+
with:
59+
r-version: release
60+
http-user-agent: release
61+
use-public-rspm: true
62+
63+
- name: Install dsBase
64+
run: |
65+
Rscript -e 'install.packages(c("RANN", "stringr", "lme4", "dplyr", "reshape2", "polycor", "gamlss", "gamlss.dist", "mice", "childsds", "usethis", "devtools"), dependencies = TRUE)'
66+
R CMD INSTALL ./dsBase
67+
68+
- uses: r-lib/actions/setup-r-dependencies@v2
69+
with:
70+
dependencies: 'c("Imports")'
71+
extra-packages: |
72+
any::rcmdcheck
73+
cran::devtools
74+
cran::git2r
75+
cran::RCurl
76+
cran::readr
77+
cran::magrittr
78+
cran::xml2
79+
cran::purrr
80+
cran::dplyr
81+
cran::stringr
82+
cran::tidyr
83+
cran::quarto
84+
cran::knitr
85+
cran::kableExtra
86+
cran::rmarkdown
87+
cran::downlit
88+
needs: check
89+
90+
- name: Check man files up-to-date
91+
run: |
92+
orig_sum=$(find man -type f | sort -u | xargs cat | md5sum)
93+
R -e "devtools::document()"
94+
new_sum=$(find man -type f | sort -u | xargs cat | md5sum)
95+
if [ "$orig_sum" != "$new_sum" ]; then
96+
echo "Your committed manual files (man/*.Rd) are out of sync with the R files. Run devtools::document() locally then commit."
97+
exit 1
98+
else
99+
echo "Documentation up-to-date."
100+
fi
101+
working-directory: dsBase
102+
continue-on-error: true
103+
104+
- name: Run devtools::check
105+
run: |
106+
R -q -e "library('devtools'); devtools::check(args = c('--no-tests', '--no-examples'))" | tee ../check.Rout
107+
grep -q "^0 errors" ../check.Rout && grep -q " 0 warnings" ../check.Rout && grep -q " 0 notes" ../check.Rout
108+
working-directory: dsBase
109+
continue-on-error: true
110+
111+
- name: Run tests with coverage & JUnit report
112+
run: |
113+
mkdir -p logs
114+
R -q -e "devtools::reload();"
115+
R -q -e '
116+
write.csv(
117+
covr::coverage_to_list(
118+
covr::package_coverage(
119+
type = c("none"),
120+
code = c('"'"'
121+
output_file <- file("test_console_output.txt");
122+
sink(output_file);
123+
sink(output_file, type = "message");
124+
junit_rep <- testthat::JunitReporter$new(file = file.path(getwd(), "test_results.xml"));
125+
progress_rep <- testthat::ProgressReporter$new(max_failures = 999999);
126+
multi_rep <- testthat::MultiReporter$new(reporters = list(progress_rep, junit_rep));
127+
testthat::test_package("${{ env.PROJECT_NAME }}", filter = "${{ env.TEST_FILTER }}", reporter = multi_rep, stop_on_failure = FALSE)'"'"'
128+
)
129+
)
130+
),
131+
"coveragelist.csv"
132+
)'
133+
134+
mv coveragelist.csv logs/
135+
mv test_* logs/
136+
grep -q " FAIL 0 " logs/test_console_output.txt
137+
working-directory: dsBase
138+
139+
- name: Check for JUnit errors
140+
run: |
141+
issue_count=$(sed 's/failures="0" errors="0"//' test_results.xml | grep -c errors= || true)
142+
echo "Number of testsuites with issues: $issue_count"
143+
sed 's/failures="0" errors="0"//' test_results.xml | grep errors= > issues.log || true
144+
cat issues.log || true
145+
exit $issue_count
146+
working-directory: dsBase/logs
147+
148+
- name: Write versions to file
149+
run: |
150+
echo "branch:${{ env.BRANCH_NAME }}" > ${{ env.WORKFLOW_ID }}.txt
151+
echo "os:$(lsb_release -ds)" >> ${{ env.WORKFLOW_ID }}.txt
152+
echo "R:$(R --version | head -n1)" >> ${{ env.WORKFLOW_ID }}.txt
153+
working-directory: dsBase/logs
154+
155+
- name: Parse results from testthat and covr
156+
run: |
157+
Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/
158+
working-directory: dsBase
159+
160+
- name: Commit results to testStatus
161+
run: |
162+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
163+
git config --global user.name "github-actions[bot]"
164+
cd testStatus
165+
166+
# Reconfigure remote to use GitHub token for authentication
167+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ env.REPO_OWNER }}/testStatus.git
168+
git checkout master
169+
git pull origin master
170+
171+
mkdir -p logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
172+
mkdir -p docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
173+
mkdir -p docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/
174+
# clear the latest directory
175+
rm -rf docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/*
176+
177+
# Copy logs to new logs directory location
178+
cp -rv ../dsBase/logs/* logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
179+
cp -rv ../dsBase/logs/${{ env.WORKFLOW_ID }}.txt logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
180+
181+
# Create symbolic links
182+
ln -sf ${{ env.WORKFLOW_ID }}/ logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/.LATEST
183+
# ln -sf docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/ docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/latest
184+
185+
R -e 'input_dir <- file.path("../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))'
186+
mv source/test_report.html docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
187+
cp -r docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest
188+
189+
git add .
190+
git commit -m "Auto test for ${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }} @ ${{ env.WORKFLOW_ID }}" || echo "No changes to commit"
191+
git push origin master
192+
193+
env:
194+
PROJECT_NAME: ${{ env.PROJECT_NAME }}
195+
BRANCH_NAME: ${{ env.BRANCH_NAME }}
196+
WORKFLOW_ID: ${{ env.WORKFLOW_ID }}
197+
198+
- name: Dump environment info
199+
run: |
200+
echo -e "\n#############################"
201+
echo -e "ls /: ######################"
202+
ls -al .
203+
echo -e "\n#############################"
204+
echo -e "lscpu: ######################"
205+
lscpu
206+
echo -e "\n#############################"
207+
echo -e "memory: #####################"
208+
free -m
209+
echo -e "\n#############################"
210+
echo -e "env: ########################"
211+
env
212+
echo -e "\n#############################"
213+
echo -e "R sessionInfo(): ############"
214+
R -e 'sessionInfo()'
215+
sudo apt install tree -y
216+
tree .
217+

.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
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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: test-coverage.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
test-coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
26+
with:
27+
extra-packages: any::covr, any::xml2
28+
needs: coverage
29+
30+
- name: Test coverage
31+
run: |
32+
cov <- covr::package_coverage(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
36+
)
37+
print(cov)
38+
covr::to_cobertura(cov)
39+
shell: Rscript {0}
40+
41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
50+
- name: Show testthat output
51+
if: always()
52+
run: |
53+
## --------------------------------------------------------------------
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
55+
shell: bash
56+
57+
- name: Upload test results
58+
if: failure()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: coverage-test-failures
62+
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
Package: dsBase
2-
Title: 'DataSHIELD' Server Site Base Functions
2+
Title: 'DataSHIELD' Server Side Base Functions
33
Description: Base 'DataSHIELD' functions for the server side. 'DataSHIELD' is a software package which allows
44
you to do non-disclosive federated analysis on sensitive data. 'DataSHIELD' analytic functions have
55
been designed to only share non disclosive summary statistics, with built in automated output
66
checking based on statistical disclosure control. With data sites setting the threshold values for
77
the automated output checks. For more details, see 'citation("dsBase")'.
8-
Version: 6.3.3
8+
Version: 6.3.4
99
Authors@R: c(person(given = "Paul",
1010
family = "Burton",
11-
role = c("aut")),
11+
role = c("aut"),
12+
comment = c(ORCID = "0000-0001-5799-9634")),
1213
person(given = "Rebecca",
1314
family = "Wilson",
14-
role = c("aut")),
15+
role = c("aut"),
16+
comment = c(ORCID = "0000-0003-2294-593X")),
1517
person(given = "Olly",
1618
family = "Butters",
17-
role = c("aut")),
19+
role = c("aut"),
20+
comment = c(ORCID = "0000-0003-0354-8461")),
1821
person(given = "Patricia",
1922
family = "Ryser-Welch",
20-
role = c("aut")),
23+
role = c("aut"),
24+
comment = c(ORCID = "0000-0002-0070-0264")),
2125
person(given = "Alex",
2226
family = "Westerberg",
2327
role = c("aut")),
@@ -37,6 +41,17 @@ Authors@R: c(person(given = "Paul",
3741
role = c("aut"),
3842
email = "yannick.marcon@obiba.org",
3943
comment = c(ORCID = "0000-0003-0138-2023")),
44+
person(given = "Tom",
45+
family = "Bishop",
46+
role = c("aut")),
47+
person(given = "Amadou",
48+
family = "Gaye",
49+
role = c("aut"),
50+
comment = c(ORCID = "0000-0002-1180-2792")),
51+
person(given = "Xavier",
52+
family = "Escribà-Montagut",
53+
role = c("aut"),
54+
comment = c(ORCID = "0000-0003-2888-8948")),
4055
person(given = "Stuart",
4156
family = "Wheater",
4257
role = c("aut", "cre"),
@@ -58,6 +73,8 @@ Imports:
5873
mice,
5974
childsds
6075
Suggests:
76+
spelling,
6177
testthat
62-
RoxygenNote: 7.3.2
78+
RoxygenNote: 7.3.3
6379
Encoding: UTF-8
80+
Language: en-GB

0 commit comments

Comments
 (0)