diff --git a/.github/workflows/R-CMD-check-occasional.yaml b/.github/workflows/R-CMD-check-occasional.yaml index 7f3dc36d8..0803b2f95 100644 --- a/.github/workflows/R-CMD-check-occasional.yaml +++ b/.github/workflows/R-CMD-check-occasional.yaml @@ -1,4 +1,5 @@ on: + push: schedule: - cron: '17 13 23 * *' # 23rd of month at 13:17 UTC workflow_dispatch: @@ -20,6 +21,8 @@ jobs: locale: ['en_US.utf8', # Multibyte characters: Mandarin 'zh_CN.utf8', + # Encoding: non-UTF-8 locales for French, Mandarin, and Russian + 'fr_CA', 'zh_CN.GB18030', 'ru_RU.KOI8-R', # fr_CA is implicitly 'ISO-8859-1' # Collate order (#3502, see also #7837): Latvian, Azeri, Hungarian, Faroese, Albanian 'lv_LV.utf8', 'az_AZ.utf8', 'hu_HU.utf8', 'fo_FO.utf8', 'sq_MK.utf8', # Local time formatting (for R bug #19117) @@ -31,6 +34,12 @@ jobs: # only run non-English locale CI on Ubuntu - os: macOS-latest locale: 'zh_CN.utf8' + - os: macOS-latest + locale: 'fr_CA.ISO-8859-1' + - os: macOS-latest + locale: 'zh_CN.GB18030' + - os: macOS-latest + locale: 'ru_RU.KOI8-R' - os: macOS-latest locale: 'lv_LV.utf8' - os: macOS-latest @@ -45,6 +54,12 @@ jobs: locale: 'vi_VN.utf8' - os: windows-latest locale: 'zh_CN.utf8' + - os: windows-latest + locale: 'fr_CA.ISO-8859-1' + - os: windows-latest + locale: 'zh_CN.GB18030' + - os: windows-latest + locale: 'ru_RU.KOI8-R' - os: windows-latest locale: 'lv_LV.utf8' - os: windows-latest @@ -85,6 +100,21 @@ jobs: with: r-version: ${{ matrix.r }} + - name: Override R for locale-specific check + if: matrix.os == 'ubuntu-latest' && !contains(matrix.locale, 'utf8') + run: | + R_BIN_DIR=$(Rscript -e 'cat(R.home("bin"))') + for bin in R Rscript; do + target="${R_BIN_DIR}/${bin}" + sudo mv "$target" "${target}.orig" + sudo tee "$target" << EOF + #!/bin/bash + set -o pipefail + exec "${target}.orig" "\$@" 2>&1 | iconv -c -t UTF-8 + EOF + sudo chmod +x "$target" + done + - name: Set script permissions run: chmod +x configure cleanup 2>/dev/null || true # Silence some GHA Annotations shell: bash