Skip to content

Commit 864632a

Browse files
authored
Merge pull request #52 from r-lib/f-gha
- Move to GitHub Actions (#52).
2 parents 257f361 + 2d1ef12 commit 864632a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+484
-9809
lines changed

.Rbuildignore

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
^rprojroot\.Rproj$
22
^\.Rproj\.user$
33
^\.gitignore$
4-
^README\.md$
5-
^Makefile$
6-
^Makefile\.in$
7-
^makeR
8-
^wercker\.yml$
9-
^readme$
10-
^appveyor\.yml$
11-
^makeR$
124
^cran-comments\.md$
13-
^inst/web$
14-
^inst/staticdocs$
15-
^\.travis\.yml$
16-
^\.deploy_key\.pub$
17-
^\.deploy_key\.enc$
18-
^scripts/deploy-pages\.sh$
195
^docs$
206
^_pkgdown\.yml$
217
^revdep$
228
^tic\.R$
239
^tests/testthat/hierarchy/a/b/\.projectile$
24-
^API$
2510
^LICENSE\.md$
11+
^\.github$
12+
^README\.Rmd$

.github/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.html
2+
R-version
3+
depends.rds
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: '0 8 * * *'
10+
11+
name: rcc dev
12+
13+
jobs:
14+
R-CMD-check:
15+
runs-on: ${{ matrix.config.os }}
16+
17+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
24+
25+
env:
26+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
27+
RSPM: ${{ matrix.config.rspm }}
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
30+
steps:
31+
- uses: actions/checkout@v2
32+
33+
- uses: r-lib/actions/setup-r@master
34+
with:
35+
r-version: ${{ matrix.config.r }}
36+
37+
- uses: r-lib/actions/setup-pandoc@master
38+
39+
- name: "Prepare timestamp for cache"
40+
if: runner.os != 'Windows'
41+
id: date
42+
run: echo "::set-output name=date::$(date -Ihours)"
43+
44+
- name: Cache R packages
45+
if: runner.os != 'Windows'
46+
uses: actions/cache@v2
47+
with:
48+
path: ${{ env.R_LIBS_USER }}
49+
key: ${{ matrix.config.os }}-r-dev-${{ matrix.config.r }}-${{steps.date.outputs.date}}
50+
restore-keys: ${{ matrix.config.os }}-r-dev-${{ matrix.config.r }}-
51+
52+
- name: Install remotes
53+
run: |
54+
install.packages("remotes")
55+
shell: Rscript {0}
56+
57+
- name: Install system dependencies
58+
if: runner.os == 'Linux'
59+
run: |
60+
while read -r cmd
61+
do
62+
eval sudo $cmd
63+
done < <(Rscript -e 'req <- remotes::system_requirements("ubuntu", "18.04"); writeLines(req)')
64+
65+
66+
- name: Install dependencies
67+
run: |
68+
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
69+
remotes::install_cran("rcmdcheck")
70+
shell: Rscript {0}
71+
72+
- name: Session info
73+
run: |
74+
options(width = 100)
75+
pkgs <- installed.packages()[, "Package"]
76+
if (!("sessioninfo" %in% pkgs)) install.packages("sessioninfo")
77+
sessioninfo::session_info(pkgs, include_base = TRUE)
78+
shell: Rscript {0}
79+
80+
- name: Check
81+
env:
82+
_R_CHECK_CRAN_INCOMING_: false
83+
_R_CHECK_SYSTEM_CLOCK_: false
84+
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false
85+
RCMDCHECK_ERROR_ON: note
86+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = Sys.getenv("RCMDCHECK_ERROR_ON"), check_dir = "check")
87+
shell: Rscript {0}
88+
89+
- name: Show testthat output
90+
if: always()
91+
run: find check -name '*.Rout*' -exec head -n 1000000 '{}' \; || true
92+
shell: bash
93+
94+
- name: Upload check results
95+
if: failure()
96+
uses: actions/upload-artifact@main
97+
with:
98+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
99+
path: check

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

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# NOTE: This workflow is overkill for most R packages
2+
# check-standard.yaml is likely a better choice
3+
# usethis::use_github_action("check-standard") will install it.
4+
#
5+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
7+
on:
8+
push:
9+
branches:
10+
- master
11+
pull_request:
12+
branches:
13+
- master
14+
15+
name: rcc
16+
17+
jobs:
18+
R-CMD-check:
19+
runs-on: ${{ matrix.config.os }}
20+
21+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
config:
27+
- {os: windows-latest, r: 'release'}
28+
- {os: windows-latest, r: 'oldrel'}
29+
- {os: macOS-latest, r: 'release'}
30+
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
31+
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
32+
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
33+
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
34+
- {os: ubuntu-16.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
35+
- {os: ubuntu-16.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
36+
37+
env:
38+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
39+
RSPM: ${{ matrix.config.rspm }}
40+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
41+
42+
steps:
43+
- uses: actions/checkout@v2
44+
45+
- uses: r-lib/actions/setup-r@master
46+
with:
47+
r-version: ${{ matrix.config.r }}
48+
http-user-agent: ${{ matrix.config.http-user-agent }}
49+
50+
- uses: r-lib/actions/setup-pandoc@master
51+
52+
- name: Query dependencies
53+
run: |
54+
install.packages('remotes')
55+
saveRDS(remotes::dev_package_deps(dependencies = TRUE, type = .Platform$pkgType), ".github/depends.Rds", version = 2)
56+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
57+
shell: Rscript {0}
58+
59+
- name: Cache R packages
60+
if: runner.os != 'Windows'
61+
uses: actions/cache@v2
62+
with:
63+
path: ${{ env.R_LIBS_USER }}
64+
key: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-2-${{ hashFiles('.github/depends.Rds') }}
65+
restore-keys: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-2-
66+
67+
- name: Install system dependencies
68+
if: runner.os == 'Linux'
69+
run: |
70+
while read -r cmd
71+
do
72+
eval sudo $cmd
73+
done < <(Rscript -e 'req <- remotes::system_requirements("ubuntu", "16.04"); writeLines(req)')
74+
75+
- name: Install dependencies
76+
run: |
77+
remotes::install_deps(dependencies = TRUE, type = .Platform$pkgType)
78+
remotes::install_cran("rcmdcheck")
79+
shell: Rscript {0}
80+
81+
- name: Session info
82+
run: |
83+
options(width = 100)
84+
pkgs <- installed.packages()[, "Package"]
85+
if (!("sessioninfo" %in% pkgs)) install.packages("sessioninfo")
86+
sessioninfo::session_info(pkgs, include_base = TRUE)
87+
shell: Rscript {0}
88+
89+
- name: Check
90+
env:
91+
_R_CHECK_CRAN_INCOMING_: false
92+
_R_CHECK_SYSTEM_CLOCK_: false
93+
_R_CHECK_FUTURE_FILE_TIMESTAMPS_: false
94+
RCMDCHECK_ERROR_ON: note
95+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = Sys.getenv("RCMDCHECK_ERROR_ON"), check_dir = "check")
96+
shell: Rscript {0}
97+
98+
- name: Show testthat output
99+
if: always()
100+
run: find check -name '*.Rout*' -exec head -n 1000000 '{}' \; || true
101+
shell: bash
102+
103+
- name: Upload check results
104+
if: failure()
105+
uses: actions/upload-artifact@main
106+
with:
107+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
108+
path: check

.github/workflows/pkgdown.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
- docs
6+
- "cran-*"
7+
8+
name: pkgdown
9+
10+
jobs:
11+
pkgdown:
12+
runs-on: ubuntu-18.04
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- uses: r-lib/actions/setup-r@master
21+
22+
- uses: r-lib/actions/setup-pandoc@master
23+
24+
- name: Query dependencies
25+
run: |
26+
install.packages("remotes")
27+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
28+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
29+
shell: Rscript {0}
30+
31+
- name: Cache R packages
32+
uses: actions/cache@v2
33+
with:
34+
path: ${{ env.R_LIBS_USER }}
35+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
36+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
37+
38+
- name: Configure Git identity
39+
run: |
40+
env | sort
41+
git config --global user.name "$GITHUB_WORKFLOW"
42+
git config --global user.email "${GITHUB_EVENT_NAME}@ghactions.local"
43+
shell: bash
44+
45+
- name: Install system dependencies
46+
if: runner.os == 'Linux'
47+
run: |
48+
while read -r cmd
49+
do
50+
eval sudo $cmd
51+
done < <(Rscript -e 'req <- remotes::system_requirements("ubuntu", "18.04"); if (length(req) > 0) cat(req, sep = "\n")')
52+
53+
- name: Install pkgdown sysdeps
54+
if: runner.os == 'Linux'
55+
env:
56+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
57+
run: |
58+
sudo apt-get install -y libharfbuzz-dev libfribidi-dev
59+
60+
- name: Install dependencies
61+
run: |
62+
install.packages("remotes")
63+
remotes::install_deps(dependencies = TRUE)
64+
remotes::install_github("krlmlr/pkgdown@fix/examples-dontshow")
65+
shell: Rscript {0}
66+
67+
- name: Install package
68+
run: R CMD INSTALL .
69+
70+
- name: Deploy package
71+
run: |
72+
pkgdown::deploy_to_branch(new_process = FALSE)
73+
shell: Rscript {0}

.github/workflows/pr-commands.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
on:
2+
issue_comment:
3+
types: [created]
4+
name: Commands
5+
jobs:
6+
document:
7+
if: startsWith(github.event.comment.body, '/document')
8+
name: document
9+
runs-on: macOS-latest
10+
env:
11+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: r-lib/actions/pr-fetch@master
15+
with:
16+
repo-token: ${{ secrets.GITHUB_TOKEN }}
17+
- uses: r-lib/actions/setup-r@master
18+
- name: Install dependencies
19+
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
20+
- name: Document
21+
run: Rscript -e 'roxygen2::roxygenise()'
22+
- name: commit
23+
run: |
24+
git add man/\* NAMESPACE
25+
git commit -m 'Document'
26+
- uses: r-lib/actions/pr-push@master
27+
with:
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
style:
30+
if: startsWith(github.event.comment.body, '/style')
31+
name: style
32+
runs-on: macOS-latest
33+
env:
34+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: r-lib/actions/pr-fetch@master
38+
with:
39+
repo-token: ${{ secrets.GITHUB_TOKEN }}
40+
- uses: r-lib/actions/setup-r@master
41+
- name: Install dependencies
42+
run: Rscript -e 'install.packages("styler")'
43+
- name: Style
44+
run: Rscript -e 'styler::style_pkg()'
45+
- name: commit
46+
run: |
47+
git add \*.R
48+
git commit -m 'Style'
49+
- uses: r-lib/actions/pr-push@master
50+
with:
51+
repo-token: ${{ secrets.GITHUB_TOKEN }}
52+
# A mock job just to ensure we have a successful build status
53+
finish:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- run: true

0 commit comments

Comments
 (0)