33# Adapted from `armadillo_azure-pipelines.yml` by Roberto Villegas-Diaz
44#
55# Inside the root directory $(Pipeline.Workspace) will be a file tree like:
6- # /dsBaseClient <- Checked out version of datashield/dsBaseClient
7- # /dsBaseClient/logs <- Where results of tests and logs are collated
8- # /testStatus <- Checked out version of datashield/testStatus
6+ # /dsBaseClient <- Checked out version of datashield/dsBaseClient
7+ # /dsBaseClient/logs <- Where results of tests and logs are collated
8+ # /testStatus <- Checked out version of datashield/testStatus
99#
1010# As of Sept. 2025 this takes ~ 95 mins to run.
1111# ###############################################################################
@@ -24,11 +24,16 @@ jobs:
2424 permissions :
2525 contents : read
2626
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.
27+ # This logic automatically selects the image tag
28+ container :
29+ image : >-
30+ ghcr.io/${{ github.repository_owner }}/ds-base-env:${{
31+ startsWith(github.ref_name, 'dev-') &&
32+ replace(github.ref_name, 'dev-', 'v') ||
33+ 'latest'
34+ }}-dev
35+ options : --user root -v /var/run/docker.sock:/var/run/docker.sock
36+
3237 env :
3338 TEST_FILTER : ' _-|datachk-|smk-|arg-|disc-|perf-|smk_expt-|expt-|math-'
3439 _r_check_system_clock_ : 0
5560 persist-credentials : false
5661 token : ${{ env.GITHUB_TOKEN }}
5762
58- - name : Uninstall default MySQL
59- run : |
60- curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
61- sudo service mysql stop || true
62- sudo apt-get update
63- sudo apt-get remove --purge mysql-client mysql-server mysql-common -y
64- sudo apt-get autoremove -y
65- sudo apt-get autoclean -y
66- sudo rm -rf /var/lib/mysql/
67-
68- - uses : r-lib/actions/setup-pandoc@v2
69-
70- - uses : r-lib/actions/setup-r@v2
71- with :
72- r-version : release
73- http-user-agent : release
74- use-public-rspm : true
75-
76- - name : Install R and dependencies
77- run : |
78- sudo apt-get install --no-install-recommends software-properties-common dirmngr -y
79- wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
80- sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
81- sudo apt-get update -qq
82- sudo apt-get upgrade -y
83- sudo apt-get install -qq libxml2-dev libcurl4-openssl-dev libssl-dev libgsl-dev libgit2-dev r-base -y
84- sudo apt-get install -qq libharfbuzz-dev libfribidi-dev libmagick++-dev xml-twig-tools -y
85- sudo R -q -e "install.packages(c('devtools','covr','fields','meta','metafor','ggplot2','gridExtra','data.table','DSI','DSOpal','DSLite','MolgenisAuth','MolgenisArmadillo','DSMolgenisArmadillo','DescTools','e1071'), repos='https://cloud.r-project.org')"
86- sudo R -q -e "devtools::install_github(repo='datashield/dsDangerClient', ref=Sys.getenv('BRANCH_NAME'))"
87-
88- - uses : r-lib/actions/setup-r-dependencies@v2
89- with :
90- dependencies : ' c("Imports")'
91- extra-packages : |
92- any::rcmdcheck
93- cran::devtools
94- cran::git2r
95- cran::RCurl
96- cran::readr
97- cran::magrittr
98- cran::xml2
99- cran::purrr
100- cran::dplyr
101- cran::stringr
102- cran::tidyr
103- cran::quarto
104- cran::knitr
105- cran::kableExtra
106- cran::rmarkdown
107- cran::downlit
108- needs : check
63+ - name : Install PR version of dsBaseClient
64+ run : R CMD INSTALL dsBaseClient
10965
11066 - name : Check manual updated
11167 run : |
@@ -169,7 +125,6 @@ jobs:
169125 ),
170126 "coveragelist.csv"
171127 )'
172-
173128 mv coveragelist.csv logs/
174129 mv test_* logs/
175130 working-directory : dsBaseClient
@@ -180,7 +135,6 @@ jobs:
180135 echo "Number of testsuites with issues: $issue_count"
181136 sed 's/failures="0" errors="0"//' test_results.xml | grep errors= > issues.log || true
182137 cat issues.log || true
183- # continue with workflow even when some tests fail
184138 exit 0
185139 working-directory : dsBaseClient/logs
186140
@@ -193,52 +147,14 @@ jobs:
193147
194148 - name : Parse results from testthat and covr
195149 run : |
196- Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/
150+ Rscript --verbose --vanilla ../testStatus/source/parse_test_report.R logs/ logs/ https://github.com/datashield/${{ env.PROJECT_NAME }}/blob/${{ env.BRANCH_NAME }} '([^:]+)' '(?<=::)[^:]+(?=::)'
197151 working-directory : dsBaseClient
152+ env :
153+ PROJECT_NAME : ${{ env.PROJECT_NAME }}
154+ BRANCH_NAME : ${{ env.BRANCH_NAME }}
198155
199156 - name : Render report
200157 run : |
201158 cd testStatus
202-
203159 mkdir -p new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
204160 mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
205- mkdir -p new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest/
206-
207- # Copy logs to new logs directory location
208- cp -rv ../dsBaseClient/logs/* new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
209- cp -rv ../dsBaseClient/logs/${{ env.WORKFLOW_ID }}.txt new/logs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/
210-
211- 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))'
212- mv source/test_report.html new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/index.html
213- cp -r new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/${{ env.WORKFLOW_ID }}/* new/docs/${{ env.PROJECT_NAME }}/${{ env.BRANCH_NAME }}/latest
214-
215- env :
216- PROJECT_NAME : ${{ env.PROJECT_NAME }}
217- BRANCH_NAME : ${{ env.BRANCH_NAME }}
218- WORKFLOW_ID : ${{ env.WORKFLOW_ID }}
219-
220- - name : Upload test logs
221- uses : actions/upload-artifact@v4
222- with :
223- name : dsbaseclient-logs
224- path : testStatus/new
225-
226- - name : Dump environment info
227- run : |
228- echo -e "\n#############################"
229- echo -e "ls /: ######################"
230- ls -al .
231- echo -e "\n#############################"
232- echo -e "lscpu: ######################"
233- lscpu
234- echo -e "\n#############################"
235- echo -e "memory: #####################"
236- free -m
237- echo -e "\n#############################"
238- echo -e "env: ########################"
239- env
240- echo -e "\n#############################"
241- echo -e "R sessionInfo(): ############"
242- R -e 'sessionInfo()'
243- sudo apt install tree -y
244- tree .
0 commit comments