|
29 | 29 | docker:
|
30 | 30 | - image: circleci/python:3.7-stretch-node-browsers
|
31 | 31 | environment:
|
| 32 | + PYLINTRC: .pylintrc37 |
32 | 33 | PYVERSION: python37
|
33 | 34 |
|
34 | 35 | steps:
|
|
81 | 82 | docker:
|
82 | 83 | - image: circleci/python:3.7-stretch-node-browsers
|
83 | 84 | environment:
|
84 |
| - PYLINTRC: .pylintrc37 |
85 | 85 | PYVERSION: python37
|
86 | 86 | steps:
|
87 | 87 | - checkout
|
@@ -213,6 +213,113 @@ jobs:
|
213 | 213 | paths:
|
214 | 214 | - packages/*.tar.gz
|
215 | 215 |
|
| 216 | + build-dashr: |
| 217 | + working_directory: ~/dashr |
| 218 | + docker: |
| 219 | + - image: plotly/dashr:ci |
| 220 | + environment: |
| 221 | + PERCY_PARALLEL_TOTAL: -1 |
| 222 | + PYVERSION: python37 |
| 223 | + _R_CHECK_FORCE_SUGGESTS_: FALSE |
| 224 | + |
| 225 | + steps: |
| 226 | + - checkout |
| 227 | + |
| 228 | + - run: |
| 229 | + name: ️️🏭 clone and npm build core for R |
| 230 | + command: | |
| 231 | + python -m venv venv |
| 232 | + . venv/bin/activate |
| 233 | + git clone --depth 1 https://github.com/plotly/dash.git -b ${CIRCLE_BRANCH} dash-main |
| 234 | + cd dash-main && pip install -e .[dev,testing] --progress-bar off && cd .. |
| 235 | + git clone --depth 1 https://github.com/plotly/dashR.git -b dev dashR |
| 236 | + git clone --depth 1 https://github.com/plotly/dash-html-components.git |
| 237 | + git clone --depth 1 https://github.com/plotly/dash-core-components.git |
| 238 | + git clone --depth 1 https://github.com/plotly/dash-table.git |
| 239 | + shopt -s extglob |
| 240 | + cd dash-html-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build) |
| 241 | + cd ../dash-core-components; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build) |
| 242 | + cd ../dash-table; npm ci && npm run build; rm -rf !(.|..|DESCRIPTION|LICENSE.txt|LICENSE|NAMESPACE|.Rbuildignore|R|man|inst|vignettes|build); cd .. |
| 243 | + |
| 244 | + - run: |
| 245 | + name: 🔧fix up dash metadata |
| 246 | + command: | |
| 247 | + sudo Rscript -e 'dash_desc <- read.dcf("dashR/DESCRIPTION"); dt_version <- read.dcf("dash-table/DESCRIPTION")[,"Version"]; dcc_version <- read.dcf("dash-core-components/DESCRIPTION")[,"Version"]; dhc_version <- read.dcf("dash-html-components/DESCRIPTION")[,"Version"]; imports <- dash_desc[,"Imports"][[1]]; imports <- gsub("((?<=dashHtmlComponents )(\\\\(.*?\\\\)))", paste0("(= ", dhc_version, ")"), imports, perl = TRUE); imports <- gsub("((?<=dashCoreComponents )(\\\\(.*?\\\\)))", paste0("(= ", dcc_version, ")"), imports, perl = TRUE); imports <- gsub("((?<=dashTable )(\\\\(.*?\\\\)))", paste0("(= ", dt_version, ")"), imports, perl = TRUE); dash_desc[,"Imports"][[1]] <- imports; dhc_hash <- system("cd dash-html-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); dcc_hash <- system("cd dash-core-components; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); dt_hash <- system("cd dash-table; git rev-parse HEAD | tr -d '\''\n'\''", intern=TRUE); remotes <- dash_desc[,"Remotes"][[1]]; remotes <- gsub("((?<=plotly\\\\/dash-html-components@)([a-zA-Z0-9]+))", dhc_hash, remotes, perl=TRUE); remotes <- gsub("((?<=plotly\\\\/dash-core-components@)([a-zA-Z0-9]+))", dcc_hash, remotes, perl=TRUE); remotes <- gsub("((?<=plotly\\\\/dash-table@)([a-zA-Z0-9]+))", dt_hash, remotes, perl=TRUE); dash_desc[,"Remotes"][[1]] <- remotes; write.dcf(dash_desc, "dashR/DESCRIPTION")' |
| 248 | +
|
| 249 | + - run: |
| 250 | + name: 🎛 set environment variables |
| 251 | + command: | |
| 252 | + Rscript --vanilla \ |
| 253 | + -e 'dash_dsc <- read.dcf("dashR/DESCRIPTION")' \ |
| 254 | + -e 'cat(sprintf("export DASH_TARBALL=%s_%s.tar.gz\n", dash_dsc[,"Package"], dash_dsc[,"Version"]))' \ |
| 255 | + -e 'cat(sprintf("export DASH_CHECK_DIR=%s.Rcheck\n", dash_dsc[,"Package"]))' \ |
| 256 | + -e 'dhc_dsc <- read.dcf("dash-html-components/DESCRIPTION")' \ |
| 257 | + -e 'cat(sprintf("export DHC_TARBALL=%s_%s.tar.gz\n", dhc_dsc[,"Package"], dhc_dsc[,"Version"]))' \ |
| 258 | + -e 'cat(sprintf("export DHC_CHECK_DIR=%s.Rcheck\n", dhc_dsc[,"Package"]))' \ |
| 259 | + -e 'dcc_dsc <- read.dcf("dash-core-components/DESCRIPTION")' \ |
| 260 | + -e 'cat(sprintf("export DCC_TARBALL=%s_%s.tar.gz\n", dcc_dsc[,"Package"], dcc_dsc[,"Version"]))' \ |
| 261 | + -e 'cat(sprintf("export DCC_CHECK_DIR=%s.Rcheck\n", dcc_dsc[,"Package"]))' \ |
| 262 | + -e 'dt_dsc <- read.dcf("dash-table/DESCRIPTION")' \ |
| 263 | + -e 'cat(sprintf("export DT_TARBALL=%s_%s.tar.gz\n", dt_dsc[,"Package"], dt_dsc[,"Version"]))' \ |
| 264 | + -e 'cat(sprintf("export DT_CHECK_DIR=%s.Rcheck\n", dt_dsc[,"Package"]))' \ |
| 265 | + >> ${BASH_ENV} |
| 266 | +
|
| 267 | + - run: |
| 268 | + name: ️️📋 run CRAN package checks |
| 269 | + command: | |
| 270 | + R CMD build dash-core-components |
| 271 | + R CMD build dash-html-components |
| 272 | + R CMD build dash-table |
| 273 | + R CMD build dashR |
| 274 | + sudo R CMD INSTALL dash-core-components |
| 275 | + sudo R CMD INSTALL dash-html-components |
| 276 | + sudo R CMD INSTALL dash-table |
| 277 | + sudo R CMD INSTALL dashR |
| 278 | + R CMD check "${DHC_TARBALL}" --as-cran --no-manual |
| 279 | + R CMD check "${DCC_TARBALL}" --as-cran --no-manual |
| 280 | + R CMD check "${DT_TARBALL}" --as-cran --no-manual |
| 281 | + R CMD check "${DASH_TARBALL}" --as-cran --no-manual |
| 282 | +
|
| 283 | + - run: |
| 284 | + name: 🕵 detect failures |
| 285 | + command: | |
| 286 | + Rscript -e "message(devtools::check_failures(path = '${DHC_CHECK_DIR}'))" |
| 287 | + Rscript -e "message(devtools::check_failures(path = '${DCC_CHECK_DIR}'))" |
| 288 | + Rscript -e "message(devtools::check_failures(path = '${DT_CHECK_DIR}'))" |
| 289 | + Rscript -e "message(devtools::check_failures(path = '${DASH_CHECK_DIR}'))" |
| 290 | + # warnings are errors; enable for stricter checks once CRAN submission finished |
| 291 | + # if grep -q -R "WARNING" "${DHC_CHECK_DIR}/00check.log"; then exit 1; fi |
| 292 | + # if grep -q -R "WARNING" "${DCC_CHECK_DIR}/00check.log"; then exit 1; fi |
| 293 | + # if grep -q -R "WARNING" "${DT_CHECK_DIR}/00check.log"; then exit 1; fi |
| 294 | + # if grep -q -R "WARNING" "${DASH_CHECK_DIR}/00check.log"; then exit 1; fi |
| 295 | +
|
| 296 | + - run: |
| 297 | + name: 🔎 run unit tests |
| 298 | + command: | |
| 299 | + sudo Rscript -e 'res=devtools::test("dashR/tests/", reporter=default_reporter());df=as.data.frame(res);if(sum(df$failed) > 0 || any(df$error)) {q(status=1)}' |
| 300 | +
|
| 301 | + - run: |
| 302 | + name: ⚙️ Integration tests |
| 303 | + command: | |
| 304 | + python -m venv venv |
| 305 | + . venv/bin/activate |
| 306 | + cd dash-main/\@plotly/dash-generator-test-component-nested && npm ci && npm run build && sudo R CMD INSTALL . && cd ../../.. |
| 307 | + cd dash-main/\@plotly/dash-generator-test-component-standard && npm ci && npm run build && sudo R CMD INSTALL . && cd ../../.. |
| 308 | + export PATH=$PATH:/home/circleci/.local/bin/ |
| 309 | + pytest --nopercyfinalize --junitxml=test-reports/dashr.xml dashR/tests/integration/dopsa/ |
| 310 | + - store_artifacts: |
| 311 | + path: test-reports |
| 312 | + - store_test_results: |
| 313 | + path: test-reports |
| 314 | + - store_artifacts: |
| 315 | + path: /tmp/dash_artifacts |
| 316 | + |
| 317 | + - run: |
| 318 | + name: 🦔 percy finalize |
| 319 | + command: npx percy finalize --all |
| 320 | + when: on_fail |
| 321 | + |
| 322 | + |
216 | 323 | test-37: &test
|
217 | 324 | working_directory: ~/dash
|
218 | 325 | docker:
|
@@ -279,12 +386,14 @@ workflows:
|
279 | 386 | - build-core-37
|
280 | 387 | - build-windows-37
|
281 | 388 | - build-misc-37
|
| 389 | + - build-dashr |
282 | 390 | - test-37:
|
283 | 391 | requires:
|
284 | 392 | - build-core-37
|
285 | 393 | - build-misc-37
|
286 | 394 | - percy-finalize:
|
287 | 395 | requires:
|
| 396 | + - build-dashr |
288 | 397 | - test-37
|
289 | 398 | - artifacts:
|
290 | 399 | requires:
|
|
0 commit comments