From 29e48c53eaccbb8a3989d451af94ff16eab4177f Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 6 May 2024 21:37:34 +0200 Subject: [PATCH 01/10] Update check-full.yaml --- .github/workflows/check-full.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index b9c209f8b..ec0c13336 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -49,6 +49,8 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: + pak-version: devel + upgrade: 'TRUE' extra-packages: any::rcmdcheck needs: check From c68e13bd91b00a1666308d85422873363957c098 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 6 May 2024 21:52:22 +0200 Subject: [PATCH 02/10] try different locale --- .github/workflows/check-full.yaml | 37 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index ec0c13336..9781aef2f 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -12,31 +12,44 @@ jobs: R-CMD-check: runs-on: ${{ matrix.config.os }} - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.locale }} strategy: fail-fast: false matrix: config: - - {os: macos-latest, r: 'release'} + - { os: macos-latest, r: "release" } - - {os: windows-latest, r: 'devel'} - - {os: windows-latest, r: 'release'} + - { os: windows-latest, r: "devel" } + - { os: windows-latest, r: "release" } # use 4.1 to check with rtools40's older compiler - - {os: windows-latest, r: '4.1'} + - { os: windows-latest, r: "4.1" } - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} + - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } + - { os: ubuntu-latest, r: "devel", locale: "en_US" } + - { os: ubuntu-latest, r: "release", locale: "zh_CN" } + - { os: ubuntu-latest, r: "oldrel-1" } + - { os: ubuntu-latest, r: "oldrel-2" } + - { os: ubuntu-latest, r: "oldrel-3" } + - { os: ubuntu-latest, r: "oldrel-4" } env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: + - name: Set locale + if: matrix.config.locale == 'en_US' + run: | + sudo locale-gen en_US + echo "LC_ALL=en_US" >> $GITHUB_ENV + + - name: Set locale + if: matrix.config.locale == 'zh_CN' + run: | + sudo locale-gen zh_CN + echo "LC_ALL=zh_CN" >> $GITHUB_ENV + - uses: actions/checkout@v4 - uses: r-lib/actions/setup-pandoc@v2 @@ -50,7 +63,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: pak-version: devel - upgrade: 'TRUE' + upgrade: "TRUE" extra-packages: any::rcmdcheck needs: check From daf6ca63471aa8439ef2e560ae673c79407153b2 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 6 May 2024 22:27:00 +0200 Subject: [PATCH 03/10] break the unicode test into two --- tests/testthat/test-parsing.R | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/testthat/test-parsing.R b/tests/testthat/test-parsing.R index 18876da8e..6f37f806e 100644 --- a/tests/testthat/test-parsing.R +++ b/tests/testthat/test-parsing.R @@ -36,10 +36,17 @@ test_that("mixed CRLF / LF EOLs fail", { ) }) -test_that("unicode can't be propprely handled on Windows for R < 4.2", { - msg <- ifelse(getRversion() < "4.2" && is_windows(), - "Can't parse input due to unicode restriction in base R\\.", - NA +test_that("unicode can't be properly handled on Windows for R < 4.2", { + skip_if_not(getRversion() < "4.2" && is_windows()) + + expect_error( + style_text('suit <- "♠"'), + "Can't parse input due to unicode restriction in base R\\." ) - expect_error(style_text('suit <- "♠"'), msg) +}) + +test_that("unicode is properly handled in all settings other than on Windows for R < 4.2", { + skip_if(getRversion() < "4.2" && is_windows()) + + expect_error(style_text('suit <- "♠"'), NA) }) From f3ab50f44c150a9cf28834111e89f33631793a78 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Mon, 6 May 2024 22:27:12 +0200 Subject: [PATCH 04/10] Update check-full.yaml --- .github/workflows/check-full.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 9781aef2f..0519ed23b 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -27,7 +27,7 @@ jobs: - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } - { os: ubuntu-latest, r: "devel", locale: "en_US" } - - { os: ubuntu-latest, r: "release", locale: "zh_CN" } + #- { os: ubuntu-latest, r: "release", locale: "zh_CN" } - { os: ubuntu-latest, r: "oldrel-1" } - { os: ubuntu-latest, r: "oldrel-2" } - { os: ubuntu-latest, r: "oldrel-3" } From 87cf5685ef9fed49a5ad60f90a3693492a25ad6e Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 9 May 2024 10:19:37 +0200 Subject: [PATCH 05/10] just create one step and make sure it works as expected --- .github/workflows/check-full.yaml | 15 ++++----------- .gitignore | 1 + 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 0519ed23b..7f0d7ef33 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -27,7 +27,7 @@ jobs: - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } - { os: ubuntu-latest, r: "devel", locale: "en_US" } - #- { os: ubuntu-latest, r: "release", locale: "zh_CN" } + - { os: ubuntu-latest, r: "release", locale: "zh_CN" } - { os: ubuntu-latest, r: "oldrel-1" } - { os: ubuntu-latest, r: "oldrel-2" } - { os: ubuntu-latest, r: "oldrel-3" } @@ -39,16 +39,9 @@ jobs: steps: - name: Set locale - if: matrix.config.locale == 'en_US' - run: | - sudo locale-gen en_US - echo "LC_ALL=en_US" >> $GITHUB_ENV - - - name: Set locale - if: matrix.config.locale == 'zh_CN' - run: | - sudo locale-gen zh_CN - echo "LC_ALL=zh_CN" >> $GITHUB_ENV + env: + OVERRIDE_LOCALE: "${{ matrix.config.locale }}" + run: echo $OVERRIDE_LOCALE >> $GITHUB_ENV - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index e0d2606ed..dbc2bbd7c 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ revdep/ touchstone/* !touchstone/config.json !touchstone/script.R +.vscode From 93718efed0746131cc83413136fd0bdd3cbb53da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 9 May 2024 08:21:24 +0000 Subject: [PATCH 06/10] pre-commit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index dbc2bbd7c..b9b86f2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .Rhistory .Rproj.user .gitsum +.vscode Meta R/scratch README.html @@ -16,4 +17,3 @@ revdep/ touchstone/* !touchstone/config.json !touchstone/script.R -.vscode From 15cf8f533c007173aa9b06b13d1a4419e7e4767a Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 9 May 2024 10:25:00 +0200 Subject: [PATCH 07/10] fixes set locale step? --- .github/workflows/check-full.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 7f0d7ef33..4a8b64848 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -39,9 +39,14 @@ jobs: steps: - name: Set locale - env: - OVERRIDE_LOCALE: "${{ matrix.config.locale }}" - run: echo $OVERRIDE_LOCALE >> $GITHUB_ENV + run: | + if [ "${{ matrix.config.locale }}" == "en_US" ]; then + sudo locale-gen en_US + echo "LC_ALL=en_US" >> $GITHUB_ENV + elif [ "${{ matrix.config.locale }}" == "zh_CN" ]; then + sudo locale-gen zh_CN + echo "LC_ALL=zh_CN" >> $GITHUB_ENV + fi - uses: actions/checkout@v4 From 9a728df8dfeadc940745e42edae535e06dcd1fbc Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 9 May 2024 10:36:26 +0200 Subject: [PATCH 08/10] also cover the case when locale is missing --- .github/workflows/check-full.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 4a8b64848..36a788509 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -40,7 +40,7 @@ jobs: steps: - name: Set locale run: | - if [ "${{ matrix.config.locale }}" == "en_US" ]; then + if [ -z "${{ matrix.config.locale }}" ] || [ "${{ matrix.config.locale }}" == "en_US" ]; then sudo locale-gen en_US echo "LC_ALL=en_US" >> $GITHUB_ENV elif [ "${{ matrix.config.locale }}" == "zh_CN" ]; then From bdc911ea4e8b8ffa79b6efe598de96045430244f Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 9 May 2024 10:39:46 +0200 Subject: [PATCH 09/10] fall back to the working solution --- .github/workflows/check-full.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 36a788509..98d6815ac 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -38,15 +38,17 @@ jobs: R_KEEP_PKG_SOURCE: yes steps: - - name: Set locale + - name: Set 'en_US' locale + if: matrix.config.locale == 'en_US' run: | - if [ -z "${{ matrix.config.locale }}" ] || [ "${{ matrix.config.locale }}" == "en_US" ]; then - sudo locale-gen en_US - echo "LC_ALL=en_US" >> $GITHUB_ENV - elif [ "${{ matrix.config.locale }}" == "zh_CN" ]; then - sudo locale-gen zh_CN - echo "LC_ALL=zh_CN" >> $GITHUB_ENV - fi + sudo locale-gen en_US + echo "LC_ALL=en_US" >> $GITHUB_ENV + + - name: Set 'zh_CN' locale + if: matrix.config.locale == 'zh_CN' + run: | + sudo locale-gen zh_CN + echo "LC_ALL=zh_CN" >> $GITHUB_ENV - uses: actions/checkout@v4 From 83de14c74663dc929cd9156948b07c1717330f47 Mon Sep 17 00:00:00 2001 From: Indrajeet Patil Date: Thu, 9 May 2024 10:45:01 +0200 Subject: [PATCH 10/10] comment out chinese locale --- .github/workflows/check-full.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml index 98d6815ac..d36be307c 100644 --- a/.github/workflows/check-full.yaml +++ b/.github/workflows/check-full.yaml @@ -27,7 +27,7 @@ jobs: - { os: ubuntu-latest, r: "devel", http-user-agent: "release" } - { os: ubuntu-latest, r: "devel", locale: "en_US" } - - { os: ubuntu-latest, r: "release", locale: "zh_CN" } + #- { os: ubuntu-latest, r: "release", locale: "zh_CN" } - { os: ubuntu-latest, r: "oldrel-1" } - { os: ubuntu-latest, r: "oldrel-2" } - { os: ubuntu-latest, r: "oldrel-3" }