Skip to content

Commit 0a7e247

Browse files
committed
Travis -> GHA
1 parent 8646cbe commit 0a7e247

File tree

4 files changed

+81
-59
lines changed

4 files changed

+81
-59
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ src\/RCS
2727
^.github$
2828
README.md$
2929
^configure.log$
30+
^\.github$

.github/.gitignore

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

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

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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", http-user-agent: "R/4.1.0 (ubuntu-20.04) R (4.1.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
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+
- uses: r-lib/actions/setup-pandoc@v1
37+
38+
- name: Query dependencies
39+
run: |
40+
install.packages('remotes')
41+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
42+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
43+
shell: Rscript {0}
44+
45+
- name: Restore R package cache
46+
uses: actions/cache@v2
47+
with:
48+
path: ${{ env.R_LIBS_USER }}
49+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
50+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
51+
52+
- name: Install system dependencies
53+
if: runner.os == 'Linux'
54+
run: |
55+
while read -r cmd
56+
do
57+
eval sudo $cmd
58+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
59+
60+
- name: Install dependencies
61+
run: |
62+
remotes::install_deps(dependencies = TRUE)
63+
remotes::install_cran("rcmdcheck")
64+
shell: Rscript {0}
65+
66+
- name: Check
67+
env:
68+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
69+
run: |
70+
options(crayon.enabled = TRUE)
71+
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
72+
shell: Rscript {0}
73+
74+
- name: Upload check results
75+
if: failure()
76+
uses: actions/upload-artifact@main
77+
with:
78+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
79+
path: check

.travis.yml

-59
This file was deleted.

0 commit comments

Comments
 (0)