From 8d909cde453bdc0b80fe92de665d022340ca6140 Mon Sep 17 00:00:00 2001 From: Jeroen Ooms Date: Sun, 28 Feb 2021 12:57:18 +0100 Subject: [PATCH] Switch to GHA; use CARGO_HOME --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 72 ++++++++++++++++++++++++++++++ .travis.yml | 29 ------------ NEWS | 3 ++ configure | 9 +--- src/Makevars.in | 2 +- 7 files changed, 79 insertions(+), 38 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .travis.yml diff --git a/.Rbuildignore b/.Rbuildignore index 3b76823..644843e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ \.png$ \.gif$ src/Makevars$ +\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..16af5d1 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,72 @@ +# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. +# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions +on: + push: + pull_request: + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} + + env: + R_REMOTES_NO_ERRORS_FROM_WARNINGS: true + RSPM: ${{ matrix.config.rspm }} + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Add more rust targets + if: runner.os == 'Windows' + run: | + rustup target add i686-pc-windows-gnu + rustup target add x86_64-pc-windows-gnu + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Install dependencies + run: | + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("rcmdcheck") + shell: Rscript {0} + + - name: Check + env: + _R_CHECK_CRAN_INCOMING_REMOTE_: false + run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") + shell: Rscript {0} + + - name: Upload check results + if: failure() + uses: actions/upload-artifact@main + with: + name: ${{ runner.os }}-r${{ matrix.config.r }}-results + path: check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index feb8625..0000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: r -cache: packages -latex: false -fortran: false -pandoc: false -r_check_args: '--run-donttest' - -matrix: - include: - - dist: trusty - - dist: xenial - - os: linux - addons: - apt: - sources: - sourceline: 'ppa:ubuntu-mozilla-security/rust-updates' - packages: cargo - - os: osx - brew_packages: rust - - os: osx - disable_homebrew: true - - os: osx - osx_image: xcode7.3 - disable_homebrew: true - before_install: sed -i.bak 's/-isysroot /-I/g' $(R RHOME)/etc/Makeconf - -addons: - apt: - packages: cargo diff --git a/NEWS b/NEWS index 2b4d956..19d011b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +0.8.6.1 + - CRAN nonsense + 0.8.6 - Update gifski crate to 0.8.6 - save_gif() now properly closes graphics device when expr errors diff --git a/configure b/configure index 0ddd278..a1082f6 100755 --- a/configure +++ b/configure @@ -8,18 +8,11 @@ if [ $? -eq 0 ]; then VERSION=$($CARGO --version) echo "Using $CARGO ($VERSION)" sed -e "s|@cargobin@|$CARGO|" src/Makevars.in > src/Makevars - - # CRAN forbids using $HOME during CMD check; try to override CARGO_HOME - if [ "$CARGO" == "/usr/bin/cargo" ] && [ "$_R_CHECK_SIZE_OF_TARBALL_" ]; then - if [ -z "$CARGO_HOME" ] && [ ! -e "$HOME/.cargo" ]; then - sed -i.bak "s|#export|export|" src/Makevars - fi - fi exit 0 fi # Try local version on MacOS, otherwise error -[[ $OSTYPE == "darwin"* ]] && curl "https://jeroen.github.io/autobrew/rust" -sSf | sh && exit 0 +[[ $OSTYPE == "darwin"* ]] && curl "https://autobrew.github.io/scripts/rust" -sSf | sh && exit 0 echo "------------------ RUST COMPILER NOT FOUND --------------------" echo "" echo "Cargo was not found on the PATH. Please install cargo / rustc:" diff --git a/src/Makevars.in b/src/Makevars.in index 4b6ad27..29360d4 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -5,7 +5,7 @@ PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lresolv -pthread CARGO = @cargobin@ # CRAN policy forbids using $HOME -#export CARGO_HOME=$(R_PACKAGE_DIR) +export CARGO_HOME=$(R_PACKAGE_DIR) #all: clean