diff --git a/.github/workflows/linuxarm.yaml b/.github/workflows/linuxarm.yaml new file mode 100644 index 000000000..fa328c13b --- /dev/null +++ b/.github/workflows/linuxarm.yaml @@ -0,0 +1,38 @@ +# Run CI for R using https://eddelbuettel.github.io/r-ci/ + +name: linuxarm + +on: + #push: + #pull_request: + workflow_dispatch: + +env: + _R_CHECK_FORCE_SUGGESTS_: "false" + +jobs: + ci: + strategy: + matrix: + include: + #- {os: ubuntu-latest} + - {os: ubuntu-24.04-arm} + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup + uses: eddelbuettel/github-actions/r-ci@master + + - name: Dependencies + run: ./run.sh install_deps + + - name: Test + run: ./run.sh run_tests + + #- name: Coverage + # if: ${{ matrix.os == 'ubuntu-latest' }} + # run: ./run.sh coverage diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 40c40340a..5bce62802 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -17,6 +17,7 @@ jobs: - {os: macos-latest} - {os: macos-13} #- {os: ubuntu-latest} + #- {os: ubuntu-24.04-arm} runs-on: ${{ matrix.os }} diff --git a/ChangeLog b/ChangeLog index 413439bf6..efa6a87b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-05-05 Dirk Eddelbuettel + + * inst/tinytest/test_sugar.R: Condition four NA-related tests away on + arm64 on Linux too + + * .github/workflows/linuxarm.yaml (jobs): Add ubuntu-24.04-arm as + optional workflow_dispatch run + 2025-04-15 Dirk Eddelbuettel * docker/ci-4.4/Dockerfile: Added based on r-base:4.4.3 diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 2b1d9a3e6..d8f4ebe0b 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -33,6 +33,8 @@ \itemize{ \item \code{Rcpp.package.skeleton()} creates \sQuote{URL} and \sQuote{BugReports} if given a GitHub username (Dirk in \ghpr{1358}) + \item Tests involving NA propagation are skipped under linux-arm64 as + they are under macos-arm (Dirk in \ghpr{1379} closing \ghit{1378}) } } } diff --git a/inst/tinytest/test_sugar.R b/inst/tinytest/test_sugar.R index 44549d95f..c6b5e3961 100644 --- a/inst/tinytest/test_sugar.R +++ b/inst/tinytest/test_sugar.R @@ -1,5 +1,5 @@ -## Copyright (C) 2010 - 2024 Dirk Eddelbuettel and Romain Francois +## Copyright (C) 2010 - 2025 Dirk Eddelbuettel and Romain Francois ## Copyright (C) 2025 Dirk Eddelbuettel, Romain Francois and IƱaki Ucar ## ## This file is part of Rcpp. @@ -23,7 +23,8 @@ Rcpp::sourceCpp("cpp/sugar.cpp") ## There are some (documented, see https://blog.r-project.org/2020/11/02/will-r-work-on-apple-silicon/index.html) ## issues with NA propagation on arm64 / macOS. We not (yet ?) do anything special so we just skip some tests -isArmMacOs <- Sys.info()[["sysname"]] == "Darwin" && Sys.info()[["machine"]] == "arm64" +## This also seems to hit arm64 on Linux (aka 'aarch64' here) +isArm <- Sys.info()[["machine"]] == "arm64" || Sys.info()[["machine"]] == "aarch64" ## Needed for a change in R 3.6.0 reducing a bias in very large samples suppressWarnings(RNGversion("3.5.0")) @@ -36,8 +37,8 @@ expect_equal( runit_abs(x,y) , list( abs(x), abs(y) ) ) # test.sugar.all.one.less <- function( ){ expect_true( runit_all_one_less( 1 ) ) expect_true( ! runit_all_one_less( 1:10 ) ) -if (!isArmMacOs) expect_true( is.na( runit_all_one_less( NA ) ) ) -if (!isArmMacOs) expect_true( is.na( runit_all_one_less( c( NA, 1) ) ) ) +if (!isArm) expect_true( is.na( runit_all_one_less( NA ) ) ) +if (!isArm) expect_true( is.na( runit_all_one_less( c( NA, 1) ) ) ) expect_true( ! runit_all_one_less( c( 6, NA) ) ) @@ -46,14 +47,14 @@ expect_true( ! runit_all_one_greater( 1 ) ) expect_true( ! runit_all_one_greater( 1:10 ) ) expect_true( runit_all_one_greater( 6:10 ) ) expect_true( ! runit_all_one_greater( c(NA, 1) ) ) -if (!isArmMacOs) expect_true( is.na( runit_all_one_greater( c(NA, 6) ) ) ) +if (!isArm) expect_true( is.na( runit_all_one_greater( c(NA, 6) ) ) ) # test.sugar.all.one.less.or.equal <- function( ){ expect_true( runit_all_one_less_or_equal( 1 ) ) expect_true( ! runit_all_one_less_or_equal( 1:10 ) ) -if (!isArmMacOs) expect_true( is.na( runit_all_one_less_or_equal( NA ) ) ) -if (!isArmMacOs) expect_true( is.na( runit_all_one_less_or_equal( c( NA, 1) ) ) ) +if (!isArm) expect_true( is.na( runit_all_one_less_or_equal( NA ) ) ) +if (!isArm) expect_true( is.na( runit_all_one_less_or_equal( c( NA, 1) ) ) ) expect_true( ! runit_all_one_less_or_equal( c( 6, NA) ) ) expect_true( runit_all_one_less_or_equal( 5 ) ) @@ -66,7 +67,7 @@ expect_true( ! fx( 1:10 ) ) expect_true( fx( 6:10 ) ) expect_true( fx( 5 ) ) expect_true( ! fx( c(NA, 1) ) ) -if (!isArmMacOs) expect_true( is.na( fx( c(NA, 6) ) ) ) +if (!isArm) expect_true( is.na( fx( c(NA, 6) ) ) ) # test.sugar.all.one.equal <- function( ){ @@ -74,7 +75,7 @@ fx <- runit_all_one_equal expect_true( ! fx( 1 ) ) expect_true( ! fx( 1:2 ) ) expect_true( fx( rep(5,4) ) ) -if (!isArmMacOs) expect_true( is.na( fx( c(5,NA) ) ) ) +if (!isArm) expect_true( is.na( fx( c(5,NA) ) ) ) expect_true(! fx( c(NA, 1) ) ) @@ -83,7 +84,7 @@ fx <- runit_all_not_equal_one expect_true( fx( 1 ) ) expect_true( fx( 1:2 ) ) expect_true( ! fx( 5 ) ) -if (!isArmMacOs) expect_true( is.na( fx( c(NA, 1) ) ) ) +if (!isArm) expect_true( is.na( fx( c(NA, 1) ) ) ) expect_true( ! fx( c(NA, 5) ) ) @@ -1620,8 +1621,8 @@ expect_error(strimws(x[1], "invalid"), info = "strimws -- bad `which` argument") ## min/max # test.sugar.min.max <- function() { ## min(empty) gives NA for integer, Inf for numeric (#844) -if (!isArmMacOs) expect_true(is.na(intmin(integer(0))), "min(integer(0))") -if (!isArmMacOs) expect_equal(doublemin(numeric(0)), Inf, info = "min(numeric(0))") +if (!isArm) expect_true(is.na(intmin(integer(0))), "min(integer(0))") +if (!isArm) expect_equal(doublemin(numeric(0)), Inf, info = "min(numeric(0))") ## max(empty_ gives NA for integer, Inf for numeric (#844) expect_true(is.na(intmax(integer(0))), "max(integer(0))")