Skip to content

Commit dd5208c

Browse files
committed
Switch to GHA; use CARGO_HOME
1 parent 5aeec17 commit dd5208c

File tree

7 files changed

+79
-39
lines changed

7 files changed

+79
-39
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
\.png$
99
\.gif$
1010
src/Makevars$
11+
\.github$

.github/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
pull_request:
6+
7+
name: R-CMD-check
8+
9+
jobs:
10+
R-CMD-check:
11+
runs-on: ${{ matrix.config.os }}
12+
13+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- {os: windows-latest, r: 'release'}
20+
- {os: macOS-latest, r: 'release'}
21+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
22+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23+
24+
env:
25+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
26+
RSPM: ${{ matrix.config.rspm }}
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- uses: r-lib/actions/setup-r@v1
33+
with:
34+
r-version: ${{ matrix.config.r }}
35+
36+
- name: Install Rust
37+
uses: actions-rs/toolchain@v1
38+
with:
39+
toolchain: stable
40+
override: true
41+
42+
- name: Add more rust targets
43+
if: runner.os == 'Windows'
44+
run: |
45+
rustup target add i686-pc-windows-gnu
46+
rustup target add x86_64-pc-windows-gnu
47+
48+
- name: Query dependencies
49+
run: |
50+
install.packages('remotes')
51+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
52+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
53+
shell: Rscript {0}
54+
55+
- name: Install dependencies
56+
run: |
57+
remotes::install_deps(dependencies = TRUE)
58+
remotes::install_cran("rcmdcheck")
59+
shell: Rscript {0}
60+
61+
- name: Check
62+
env:
63+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
64+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
65+
shell: Rscript {0}
66+
67+
- name: Upload check results
68+
if: failure()
69+
uses: actions/upload-artifact@main
70+
with:
71+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
72+
path: check

.travis.yml

-29
This file was deleted.

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
0.8.6.1
2+
- CRAN nonsense
3+
14
0.8.6
25
- Update gifski crate to 0.8.6
36
- save_gif() now properly closes graphics device when expr errors

configure

+1-9
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,11 @@ if [ $? -eq 0 ]; then
77
CARGO=$(which cargo)
88
VERSION=$($CARGO --version)
99
echo "Using $CARGO ($VERSION)"
10-
sed -e "s|@cargobin@|$CARGO|" src/Makevars.in > src/Makevars
11-
12-
# CRAN forbids using $HOME during CMD check; try to override CARGO_HOME
13-
if [ "$CARGO" == "/usr/bin/cargo" ] && [ "$_R_CHECK_SIZE_OF_TARBALL_" ]; then
14-
if [ -z "$CARGO_HOME" ] && [ ! -e "$HOME/.cargo" ]; then
15-
sed -i.bak "s|#export|export|" src/Makevars
16-
fi
17-
fi
1810
exit 0
1911
fi
2012

2113
# Try local version on MacOS, otherwise error
22-
[[ $OSTYPE == "darwin"* ]] && curl "https://jeroen.github.io/autobrew/rust" -sSf | sh && exit 0
14+
[[ $OSTYPE == "darwin"* ]] && curl "https://autobrew.github.io/scripts/rust" -sSf | sh && exit 0
2315
echo "------------------ RUST COMPILER NOT FOUND --------------------"
2416
echo ""
2517
echo "Cargo was not found on the PATH. Please install cargo / rustc:"

src/Makevars.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PKG_LIBS = -L$(LIBDIR) -lmyrustlib -lresolv -pthread
55
CARGO = @cargobin@
66

77
# CRAN policy forbids using $HOME
8-
#export CARGO_HOME=$(R_PACKAGE_DIR)
8+
export CARGO_HOME=$(R_PACKAGE_DIR)
99

1010
#all: clean
1111

0 commit comments

Comments
 (0)