|
| 1 | +on: |
| 2 | + workflow_dispatch: |
| 3 | + inputs: |
| 4 | + debug_enabled: |
| 5 | + type: boolean |
| 6 | + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' |
| 7 | + required: false |
| 8 | + default: false |
| 9 | + |
| 10 | +name: tmate |
| 11 | + |
| 12 | +jobs: |
| 13 | + R-CMD-check: |
| 14 | + timeout-minutes: 120 |
| 15 | + |
| 16 | + runs-on: ${{ matrix.config.os }} |
| 17 | + |
| 18 | + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.label }} |
| 19 | + |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + config: |
| 24 | +# - {os: windows-latest, r: 'devel' } |
| 25 | + - {os: windows-latest, r: 'release', parallelly: 'develop' } |
| 26 | +# - {os: windows-latest, r: 'oldrel' } |
| 27 | +# - {os: macOS-latest, r: 'devel' } |
| 28 | +# - {os: macOS-latest, r: 'release' } |
| 29 | +# - {os: macOS-latest, r: 'oldrel' } |
| 30 | +# - {os: ubuntu-latest, r: 'devel' } |
| 31 | +# - {os: ubuntu-latest, r: 'release' } |
| 32 | +# - {os: ubuntu-latest, r: 'oldrel' } |
| 33 | +# - {os: ubuntu-latest, r: 'oldrel-1' } |
| 34 | +# - {os: ubuntu-latest, r: 'oldrel-2' } |
| 35 | +# - {os: ubuntu-latest, r: '4.0' } |
| 36 | +# |
| 37 | +# - {os: ubuntu-latest, r: 'release' , availablecores: 1, label: 'availableCores.system=1' } |
| 38 | +# - {os: ubuntu-latest, r: 'release' , availablecores: 2, label: 'availableCores.system=2' } |
| 39 | +# - {os: ubuntu-latest, r: 'release' , language: ko, label: ko } |
| 40 | +# - {os: ubuntu-latest, r: 'release' , language: zh_CN, label: zh_CN } |
| 41 | +# - {os: ubuntu-latest, r: 'release' , language: zh_TW, label: zh_TW } |
| 42 | +# - {os: ubuntu-latest, r: 'release' , globals_keepWhere: true, label: 'keepWhere' } |
| 43 | +# - {os: ubuntu-latest, r: 'release' , globals_keepWhere: false, label: '!keepWhere' } |
| 44 | +# - {os: ubuntu-latest, r: 'release' , plan: multicore, fork_multithreading_enable: false, label: 'multicore, no-multithreading-in-forks' } |
| 45 | +# - {os: ubuntu-latest, r: 'release' , plan: multisession, fork_multithreading_enable: false, label: 'multisession, no-multithreading-in-forks' } |
| 46 | +# - {os: ubuntu-latest, r: 'release' , psock_relay_immediate: false, label: 'no-immediate-relay-in-psock' } |
| 47 | + |
| 48 | + env: |
| 49 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + R_KEEP_PKG_SOURCE: yes |
| 51 | + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 52 | + ## Test in other locale (optional) |
| 53 | + LANGUAGE: ${{ matrix.config.language }} |
| 54 | + ## R (>= 4.4.0) Note, no trailing underscore (sic!) |
| 55 | + _R_COMPARE_LANG_OBJECTS: eqonly |
| 56 | + ## R CMD check |
| 57 | + _R_CHECK_CRAN_INCOMING_: false |
| 58 | + _R_CHECK_MATRIX_DATA_: true |
| 59 | + _R_CHECK_SUGGESTS_ONLY_: true |
| 60 | + _R_CHECK_THINGS_IN_TEMP_DIR_: true |
| 61 | + _R_CHECK_TESTS_NLINES_: 300 |
| 62 | + RCMDCHECK_ERROR_ON: note |
| 63 | + ## Specific to futures |
| 64 | + R_PARALLELLY_AVAILABLECORES_SYSTEM: ${{ matrix.config.availablecores }} |
| 65 | + R_FUTURE_RNG_ONMISUSE: error |
| 66 | + R_FUTURE_GLOBALS_KEEPWHERE: ${{ matrix.config.globals_keepWhere }} |
| 67 | + R_PARALLELLY_BRANCH: ${{ matrix.config.parallelly }} |
| 68 | + |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + |
| 72 | + - name: Setup and launch tmate session |
| 73 | + uses: mxschmitt/action-tmate@v3 |
| 74 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} |
| 75 | + with: |
| 76 | + detached: true |
| 77 | + limit-access-to-actor: true |
| 78 | + |
| 79 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 80 | + |
| 81 | + - uses: r-lib/actions/setup-r@v2 |
| 82 | + with: |
| 83 | + r-version: ${{ matrix.config.r }} |
| 84 | + http-user-agent: ${{ matrix.config.http-user-agent }} |
| 85 | + use-public-rspm: true |
| 86 | + |
| 87 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 88 | + with: |
| 89 | + extra-packages: | |
| 90 | + any::rcmdcheck |
| 91 | + any::remotes |
| 92 | + needs: check |
| 93 | + |
| 94 | + - name: Install package itself (special case) |
| 95 | + run: | |
| 96 | + install.packages(".", repos = NULL, type = "source") ## needed by parallel workers |
| 97 | + pver <- Sys.getenv("R_PARALLELLY_BRANCH") |
| 98 | + if (nzchar(pver)) { |
| 99 | + remotes::install_github("futureverse/parallelly", ref = pver) |
| 100 | + } |
| 101 | + |
| 102 | + shell: Rscript {0} |
| 103 | + |
| 104 | + - name: Session info |
| 105 | + run: | |
| 106 | + options(width = 100) |
| 107 | + parallelly::availableCores(which = "all") |
| 108 | + sapply(c(physical_cores = FALSE, logical_cores = TRUE), parallel::detectCores) |
| 109 | + if (require(RhpcBLASctl, quietly=TRUE)) c(get_num_procs = get_num_procs(), get_num_cores = get_num_cores(), blas_get_num_procs = blas_get_num_procs(), omp_get_num_procs = omp_get_num_procs(), omp_get_max_threads = omp_get_max_threads()) |
| 110 | + capabilities() |
| 111 | + pkgs <- installed.packages()[, "Package"] |
| 112 | + sessioninfo::session_info(pkgs, include_base = TRUE) |
| 113 | + ## Verify LANGUAGE settings by generating a translatable error |
| 114 | + cat(sprintf("LANGUAGE=%s\n", sQuote(Sys.getenv("LANGUAGE")))) |
| 115 | + cat(sprintf("locales: %s\n", sQuote(Sys.getlocale()))) |
| 116 | + tryCatch(log("a"), error = conditionMessage) |
| 117 | + shell: Rscript {0} |
| 118 | + |
| 119 | + - name: Check |
| 120 | + if: runner.os != 'Windows' |
| 121 | + env: |
| 122 | + ## FIXME: Eventually update to 'R_FUTURE_GLOBALS_ONREFERENCE=error' |
| 123 | + R_FUTURE_GLOBALS_ONREFERENCE: "warning" |
| 124 | + R_FUTURE_PLAN: ${{ matrix.config.plan }} |
| 125 | + R_FUTURE_FORK_ENABLE: ${{ matrix.config.fork_enable }} |
| 126 | + R_FUTURE_FORK_MULTITHREADING_ENABLE: ${{ matrix.config.fork_multithreading_enable }} |
| 127 | + R_FUTURE_PSOCK_RELAY_IMMEDIATE: ${{ matrix.config.psock_relay_immediate }} |
| 128 | + run: | |
| 129 | + if (nzchar(Sys.getenv("R_FUTURE_PLAN")) || getRversion() < "3.5.0") Sys.setenv(RCMDCHECK_ERROR_ON = "error") |
| 130 | + rcmdcheck::rcmdcheck( |
| 131 | + build_args = if (getRversion() < "3.5.0") "--no-build-vignettes", |
| 132 | + args = c("--no-manual", "--as-cran", if (getRversion() < "3.5.0") c("--no-vignettes", "--no-build-vignettes", "--ignore-vignettes")), |
| 133 | + check_dir = "check" |
| 134 | + ) |
| 135 | + shell: Rscript {0} |
| 136 | + |
| 137 | + - name: Check (Windows) |
| 138 | + if: runner.os == 'Windows' |
| 139 | + run: | |
| 140 | + rcmdcheck::rcmdcheck( |
| 141 | + args = c("--no-manual", "--as-cran", if (.Platform$OS.type == "windows" && getRversion() >= "4.2.0") "--no-multiarch"), |
| 142 | + check_dir = "check" |
| 143 | + ) |
| 144 | + shell: Rscript {0} |
| 145 | + |
| 146 | + - name: Upload check results |
| 147 | + if: failure() |
| 148 | + uses: actions/upload-artifact@v4 |
| 149 | + with: |
| 150 | + name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
| 151 | + path: check |
0 commit comments