|
1 | 1 | on: [push, pull_request] |
2 | | - |
| 2 | + |
3 | 3 | name: R-CMD-check |
4 | 4 |
|
5 | 5 | jobs: |
@@ -28,158 +28,106 @@ jobs: |
28 | 28 | - {os: ubuntu-latest, r: 'oldrel-1' } |
29 | 29 | - {os: ubuntu-latest, r: 'oldrel-2' } |
30 | 30 | - {os: ubuntu-latest, r: '4.0' } |
31 | | - - {os: windows-latest, r: 'release' , prune_functions: true, label: 'prune' } |
32 | | - - {os: macOS-latest, r: 'release' , prune_functions: true, label: 'prune' } |
33 | | - - {os: ubuntu-latest, r: 'devel' , prune_functions: true, label: 'prune' } |
34 | | - - {os: ubuntu-latest, r: 'release' , prune_functions: true, label: 'prune' } |
35 | | - - {os: ubuntu-latest, r: 'oldrel' , prune_functions: true, label: 'prune' } |
36 | | - |
| 31 | + - {os: ubuntu-latest, r: 'release' , availablecores: 1, label: 'availableCores.system=1' } |
| 32 | + - {os: ubuntu-latest, r: 'release' , availablecores: 2, label: 'availableCores.system=2' } |
| 33 | + - {os: ubuntu-latest, r: 'release' , language: ko, label: ko } |
| 34 | + - {os: ubuntu-latest, r: 'release' , language: zh_CN, label: zh_CN } |
| 35 | + - {os: ubuntu-latest, r: 'release' , language: zh_TW, label: zh_TW } |
| 36 | + |
37 | 37 | env: |
38 | 38 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
39 | 39 | R_KEEP_PKG_SOURCE: yes |
40 | 40 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
| 41 | + ## Test in other locale (optional) |
| 42 | + LANGUAGE: ${{ matrix.config.language }} |
| 43 | + ## R (>= 4.4.0) Note, no trailing underscore (sic!) |
| 44 | + _R_COMPARE_LANG_OBJECTS: eqonly |
41 | 45 | ## R CMD check |
42 | | - RCMDCHECK_ERROR_ON: note |
43 | 46 | _R_CHECK_CRAN_INCOMING_: false |
44 | | - _R_CHECK_LENGTH_1_CONDITION_: true |
45 | | - _R_CHECK_LENGTH_1_LOGIC2_: true |
46 | 47 | _R_CHECK_MATRIX_DATA_: true |
47 | 48 | _R_CHECK_SUGGESTS_ONLY_: true |
48 | | - ## Specific to futures |
49 | | - R_FUTURE_PRUNE_FUNCTIONS: ${{ matrix.config.prune_functions }} |
50 | | - R_FUTURE_GLOBALS_KEEPWHERE: ${{ matrix.config.globals_keepWhere }} |
51 | | - |
52 | | - steps: |
53 | | - - uses: actions/checkout@v4 |
54 | | - |
55 | | - - uses: r-lib/actions/setup-pandoc@v2 |
56 | | - |
57 | | - - uses: r-lib/actions/setup-tinytex@v2 |
58 | | - |
59 | | - - name: Install system dependencies (Linux) |
60 | | - if: runner.os == 'Linux' |
61 | | - run: sudo apt-get install -y tidy |
62 | | - |
63 | | - - uses: r-lib/actions/setup-r@v2 |
64 | | - with: |
65 | | - r-version: ${{ matrix.config.r }} |
66 | | - |
67 | | - - uses: r-lib/actions/setup-r-dependencies@v2 |
68 | | - with: |
69 | | - extra-packages: any::rcmdcheck, any::remotes |
70 | | - needs: check |
71 | | - |
72 | | - - name: Install R package dependencies (part 2) |
73 | | - run: | |
74 | | - install.packages(".", repos = NULL, type = "source") ## self vignette engine |
75 | | - if (isTRUE(as.logical("${{ matrix.config.prune_functions }}"))) remotes::install_github("HenrikBengtsson/future", ref="feature/environments") |
76 | | - shell: Rscript {0} |
77 | | - |
78 | | - - name: Session info |
79 | | - run: | |
80 | | - options(width = 100) |
81 | | - capabilities() |
82 | | - pkgs <- installed.packages()[, "Package"] |
83 | | - sessioninfo::session_info(pkgs, include_base = TRUE) |
84 | | - shell: Rscript {0} |
85 | | - |
86 | | - - name: Check (!Windows) |
87 | | - if: runner.os != 'Windows' |
88 | | - run: | |
89 | | - rcmdcheck::rcmdcheck( |
90 | | - args = "--as-cran", |
91 | | - check_dir = "check" |
92 | | - ) |
93 | | - shell: Rscript {0} |
94 | | - |
95 | | - - name: Check (Windows) |
96 | | - if: runner.os == 'Windows' |
97 | | - run: | |
98 | | - remotes::install_github("HenrikBengtsson/future", ref = "develop") |
99 | | - rcmdcheck::rcmdcheck( |
100 | | - - {os: ubuntu-latest, r: 'devel' , prune_functions: true, label: 'prune' } |
101 | | - - {os: ubuntu-latest, r: 'release' , prune_functions: true, label: 'prune' } |
102 | | - - {os: ubuntu-latest, r: 'oldrel' , prune_functions: true, label: 'prune' } |
103 | | -
|
104 | | - env: |
105 | | - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
106 | | - R_KEEP_PKG_SOURCE: yes |
107 | | - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true |
108 | | - ## R CMD check |
| 49 | + _R_CHECK_THINGS_IN_TEMP_DIR_: true |
| 50 | + _R_CHECK_TESTS_NLINES_: 300 |
109 | 51 | RCMDCHECK_ERROR_ON: note |
110 | | - _R_CHECK_CRAN_INCOMING_: false |
111 | | - _R_CHECK_LENGTH_1_CONDITION_: true |
112 | | - _R_CHECK_LENGTH_1_LOGIC2_: true |
113 | | - _R_CHECK_MATRIX_DATA_: true |
114 | | - _R_CHECK_SUGGESTS_ONLY_: true |
115 | 52 | ## Specific to futures |
116 | | - R_FUTURE_PRUNE_FUNCTIONS: ${{ matrix.config.prune_functions }} |
| 53 | + R_PARALLELLY_AVAILABLECORES_SYSTEM: ${{ matrix.config.availablecores }} |
| 54 | + R_FUTURE_RNG_ONMISUSE: error |
117 | 55 | R_FUTURE_GLOBALS_KEEPWHERE: ${{ matrix.config.globals_keepWhere }} |
118 | | - |
| 56 | + R_PARALLELLY_BRANCH: ${{ matrix.config.parallelly }} |
| 57 | + |
119 | 58 | steps: |
120 | 59 | - uses: actions/checkout@v4 |
121 | 60 |
|
122 | 61 | - uses: r-lib/actions/setup-pandoc@v2 |
123 | 62 |
|
124 | | - - uses: r-lib/actions/setup-tinytex@v2 |
125 | | - |
126 | | - - name: Install system dependencies (Linux) |
127 | | - if: runner.os == 'Linux' |
128 | | - run: sudo apt-get install -y tidy |
129 | | - |
130 | 63 | - uses: r-lib/actions/setup-r@v2 |
131 | 64 | with: |
132 | 65 | r-version: ${{ matrix.config.r }} |
133 | | - |
| 66 | + http-user-agent: ${{ matrix.config.http-user-agent }} |
| 67 | + use-public-rspm: true |
| 68 | + |
134 | 69 | - uses: r-lib/actions/setup-r-dependencies@v2 |
135 | 70 | with: |
136 | | - extra-packages: any::rcmdcheck, any::remotes |
| 71 | + extra-packages: | |
| 72 | + any::rcmdcheck |
| 73 | + any::remotes |
137 | 74 | needs: check |
138 | 75 |
|
139 | | - - name: Install R package dependencies (part 2) |
| 76 | + - name: Install package itself (special case) |
140 | 77 | run: | |
141 | | - install.packages(".", repos = NULL, type = "source") ## self vignette engine |
142 | | - if (isTRUE(as.logical("${{ matrix.config.prune_functions }}"))) remotes::install_github("HenrikBengtsson/future", ref="feature/environments") |
| 78 | + install.packages(".", repos = NULL, type = "source") ## needed by parallel workers |
| 79 | + pver <- Sys.getenv("R_PARALLELLY_BRANCH") |
| 80 | + if (nzchar(pver)) { |
| 81 | + remotes::install_github("futureverse/parallelly", ref = pver) |
| 82 | + } |
| 83 | + |
143 | 84 | shell: Rscript {0} |
144 | 85 |
|
145 | 86 | - name: Session info |
146 | 87 | run: | |
147 | 88 | options(width = 100) |
| 89 | + parallelly::availableCores(which = "all") |
| 90 | + sapply(c(physical_cores = FALSE, logical_cores = TRUE), parallel::detectCores) |
| 91 | + 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()) |
148 | 92 | capabilities() |
149 | 93 | pkgs <- installed.packages()[, "Package"] |
150 | 94 | sessioninfo::session_info(pkgs, include_base = TRUE) |
| 95 | + ## Verify LANGUAGE settings by generating a translatable error |
| 96 | + cat(sprintf("LANGUAGE=%s\n", sQuote(Sys.getenv("LANGUAGE")))) |
| 97 | + cat(sprintf("locales: %s\n", sQuote(Sys.getlocale()))) |
| 98 | + tryCatch(log("a"), error = conditionMessage) |
151 | 99 | shell: Rscript {0} |
152 | 100 |
|
153 | | - - name: Check (!Windows) |
| 101 | + - name: Check |
154 | 102 | if: runner.os != 'Windows' |
| 103 | + env: |
| 104 | + ## FIXME: Eventually update to 'R_FUTURE_GLOBALS_ONREFERENCE=error' |
| 105 | + R_FUTURE_GLOBALS_ONREFERENCE: "warning" |
| 106 | + R_FUTURE_PLAN: ${{ matrix.config.plan }} |
| 107 | + R_FUTURE_FORK_ENABLE: ${{ matrix.config.fork_enable }} |
| 108 | + R_FUTURE_FORK_MULTITHREADING_ENABLE: ${{ matrix.config.fork_multithreading_enable }} |
| 109 | + R_FUTURE_PSOCK_RELAY_IMMEDIATE: ${{ matrix.config.psock_relay_immediate }} |
155 | 110 | run: | |
| 111 | + if (nzchar(Sys.getenv("R_FUTURE_PLAN")) || getRversion() < "3.5.0") Sys.setenv(RCMDCHECK_ERROR_ON = "error") |
156 | 112 | rcmdcheck::rcmdcheck( |
157 | | - args = "--as-cran", |
| 113 | + build_args = if (getRversion() < "3.5.0") "--no-build-vignettes", |
| 114 | + args = c("--no-manual", "--as-cran", if (getRversion() < "3.5.0") c("--no-vignettes", "--no-build-vignettes", "--ignore-vignettes")), |
158 | 115 | check_dir = "check" |
159 | 116 | ) |
160 | 117 | shell: Rscript {0} |
161 | | - |
| 118 | + |
162 | 119 | - name: Check (Windows) |
163 | 120 | if: runner.os == 'Windows' |
164 | 121 | run: | |
165 | | - remotes::install_github("HenrikBengtsson/future", ref = "develop") |
166 | 122 | rcmdcheck::rcmdcheck( |
167 | | - args = c("--no-manual", "--as-cran"), |
168 | | - check_dir = "check" |
169 | | - ) |
170 | | - shell: Rscript {0} |
171 | | - |
172 | | - - name: Upload check results |
173 | | - if: failure() |
174 | | - uses: actions/upload-artifact@v4 |
175 | | - with: |
176 | | - name: ${{ runner.os }}-r${{ matrix.config.r }}-results |
177 | | - path: check |
178 | 123 | args = c( |
179 | 124 | "--as-cran", |
180 | 125 | if (.Platform[["OS.type"]] == "windows" || |
181 | 126 | grepl("darwin", R.version[["os"]], ignore.case = TRUE)) |
182 | | - "--no-manual" |
| 127 | + "--no-manual", |
| 128 | + if (.Platform[["OS.type"]] == "windows" && |
| 129 | + getRversion() >= "4.2.0") |
| 130 | + "--no-multiarch" |
183 | 131 | ), |
184 | 132 | check_dir = "check" |
185 | 133 | ) |
|
0 commit comments