Skip to content

Commit 56c19d2

Browse files
Changes from villegar/v6.3.3-dev into v6.3.4-dev
2 parents f2f1231 + 32b9639 commit 56c19d2

7 files changed

Lines changed: 412 additions & 24 deletions

File tree

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

.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

README.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
1-
dsBase
2-
======
1+
## dsBase: 'DataSHIELD' Server Side Base Functions
32

4-
DataSHIELD server side base R library.
3+
[![License](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
4+
[![](https://www.r-pkg.org/badges/version/dsBase?color=black)](https://cran.r-project.org/package=dsBase)
5+
[![R build
6+
status](https://github.com/datashield/dsBase/workflows/R-CMD-check/badge.svg)](https://github.com/datashield/dsBase/actions)
57

6-
[![License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
8+
## Installation
79

8-
About
9-
=====
10+
You can install the released version of dsBase from
11+
[CRAN](https://cran.r-project.org/package=dsBase) with:
12+
13+
``` r
14+
install.packages("dsBase")
15+
```
16+
17+
And the development version from
18+
[GitHub](https://github.com/datashield/dsBase/) with:
19+
<!-- You can install the development version from [GitHub](https://github.com/) with: -->
20+
21+
``` r
22+
install.packages("remotes")
23+
remotes::install_github("datashield/dsBase", "<BRANCH>")
24+
25+
# Install v6.4.0 with the following
26+
remotes::install_github("datashield/dsBase", "v6.4.0-dev")
27+
```
28+
29+
For a full list of development branches, checkout https://github.com/datashield/dsBase/branches
30+
31+
32+
## About
1033

1134
DataSHIELD is a software package which allows you to do non-disclosive federated analysis on sensitive data. Our website (https://www.datashield.org) has in depth descriptions of what it is, how it works and how to install it. A key point to highlight is that DataSHIELD has a client-server infrastructure, so the dsBase package (https://github.com/datashield/dsBase) needs to be used in conjuction with the dsBaseClient package (https://github.com/datashield/dsBaseClient) - trying to use one without the other makes no sense.
1235

@@ -18,3 +41,30 @@ Detailed instructions on how to install DataSHIELD are at https://wiki.datashiel
1841
| obiba CRAN | Where you probably should install DataSHIELD from. |
1942
| releases | Stable releases. |
2043
| master branch | Mostly in sync with the latest release, changes rarely. |
44+
45+
## References
46+
47+
[1] Burton P, Wilson R, Butters O, Ryser-Welch P, Westerberg A, Abarrategui L, Villegas-Diaz R,
48+
Avraam D, Marcon Y, Bishop T, Gaye A, Escribà Montagut X, Wheater S (2025). _dsBase: 'DataSHIELD' Server Side Base Functions_. R
49+
package version 6.3.3. <https://doi.org/10.32614/CRAN.package.dsBase>.
50+
51+
[2] Gaye A, Marcon Y, Isaeva J, LaFlamme P, Turner A, Jones E, Minion J, Boyd A, Newby C, Nuotio
52+
M, Wilson R, Butters O, Murtagh B, Demir I, Doiron D, Giepmans L, Wallace S, Budin-Ljøsne I,
53+
Oliver Schmidt C, Boffetta P, Boniol M, Bota M, Carter K, deKlerk N, Dibben C, Francis R,
54+
Hiekkalinna T, Hveem K, Kvaløy K, Millar S, Perry I, Peters A, Phillips C, Popham F, Raab G,
55+
Reischl E, Sheehan N, Waldenberger M, Perola M, van den Heuvel E, Macleod J, Knoppers B,
56+
Stolk R, Fortier I, Harris J, Woffenbuttel B, Murtagh M, Ferretti V, Burton P (2014).
57+
“DataSHIELD: taking the analysis to the data, not the data to the analysis.” _International
58+
Journal of Epidemiology_, *43*(6), 1929-1944. <https://doi.org/10.1093/ije/dyu188>.
59+
60+
[3] Wilson R, W. Butters O, Avraam D, Baker J, Tedds J, Turner A, Murtagh M, R. Burton P (2017).
61+
“DataSHIELD – New Directions and Dimensions.” _Data Science Journal_, *16*(21), 1-21.
62+
<https://doi.org/10.5334/dsj-2017-021>.
63+
64+
[4] Avraam D, Wilson R, Aguirre Chan N, Banerjee S, Bishop T, Butters O, Cadman T, Cederkvist L,
65+
Duijts L, Escribà Montagut X, Garner H, Gonçalves G, González J, Haakma S, Hartlev M,
66+
Hasenauer J, Huth M, Hyde E, Jaddoe V, Marcon Y, Mayrhofer M, Molnar-Gabor F, Morgan A,
67+
Murtagh M, Nestor M, Nybo Andersen A, Parker S, Pinot de Moira A, Schwarz F,
68+
Strandberg-Larsen K, Morris AvSwertz, Welten M, Wheater S, Burton P (2024). “DataSHIELD:
69+
mitigating disclosure risk in a multi-site federated analysis platform.” _Bioinformatics
70+
Advances_, *5*(1), 1-21. <https://doi.org/10.1093/bioadv/vbaf046>.

docs/authors.html

Lines changed: 48 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)