Skip to content

Commit

Permalink
Merge pull request #1200 from r-lib/check-win-devel-stringi-install
Browse files Browse the repository at this point in the history
Add non-US locale and use pak to upgrade packages in GHA
  • Loading branch information
IndrajeetPatil authored May 9, 2024
2 parents d0b47dc + 83de14c commit 99afa8d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
37 changes: 26 additions & 11 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 'en_US' locale
if: matrix.config.locale == 'en_US'
run: |
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

- uses: r-lib/actions/setup-pandoc@v2
Expand All @@ -49,6 +62,8 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
upgrade: "TRUE"
extra-packages: any::rcmdcheck
needs: check

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.Rhistory
.Rproj.user
.gitsum
.vscode
Meta
R/scratch
README.html
Expand Down
17 changes: 12 additions & 5 deletions tests/testthat/test-parsing.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

0 comments on commit 99afa8d

Please # to comment.