From 0e7c00e6531487736641db91c12534f6a890dbb5 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Wed, 3 Apr 2024 14:12:32 +0200 Subject: [PATCH] fix R tests --- .github/workflows/build.yml | 9 +++++---- .github/workflows/test.yml | 18 +++++++++--------- scripts/test-r.sh | 14 ++++++++------ 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47f0a49..befbfea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,11 +116,12 @@ jobs: target: i686 python-architecture: x86 interpreter: 3.8 3.9 3.10 3.11 3.12 - - os: windows - target: aarch64 - interpreter: "3.12" - # interpreter: 3.11 3.12 + # - os: windows + # target: aarch64 + # interpreter: 3.11 3.12 # NOTE: getting error `lld-link: error: could not open 'python311.lib': no such file or directory` + # I don't see how this error can even happen. We have the same workflow as many other working repos, + # and here just windows cant find python. So that's an overall windows config problem, not a problem with this repo. runs-on: ${{ (matrix.os == 'linux' && 'ubuntu') || matrix.os }}-latest steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a1c97b..7979679 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -77,15 +77,15 @@ jobs: - name: Run tests run: ./scripts/test-python.sh - # test-r: - # name: 📈 Test R - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: r-lib/actions/setup-r@v2 - # - run: rustup update - # - name: Run tests - # run: ./scripts/test-r.sh --install + test-r: + name: 📈 Test R + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + - run: rustup update + - name: Run tests + run: ./scripts/test-r.sh --install docs: name: 📚 Update docs website diff --git a/scripts/test-r.sh b/scripts/test-r.sh index 57fa999..efd2e52 100755 --- a/scripts/test-r.sh +++ b/scripts/test-r.sh @@ -13,11 +13,13 @@ for arg in "$@"; do done if [ "$INSTALL_DEPS" = true ]; then - Rscript -e 'install.packages("usethis")' - Rscript -e 'install.packages("devtools")' - Rscript -e 'install.packages("testthat")' - Rscript -e 'install.packages("rextendr")' + Rscript -e 'install.packages("usethis"); install.packages("devtools"); install.packages("testthat"); install.packages("rextendr"); rextendr::document("./r"); library(testthat); test_dir("r/tests");' + # NOTE: the packages installed in separate Rscript commands are not available in the next command, so we need to install them all in one command + # Rscript -e 'install.packages("usethis")' + # Rscript -e 'install.packages("devtools")' + # Rscript -e 'install.packages("testthat")' + # Rscript -e 'install.packages("rextendr")' # Rscript -e 'remotes::install_github("extendr/rextendr")' +else + Rscript -e 'rextendr::document("./r"); library(testthat); test_dir("r/tests");' fi - -Rscript -e 'rextendr::document("./r"); library(testthat); test_dir("r/tests");'