Skip to content

Commit 9bf3c9f

Browse files
committed
first attempt at github actions
1 parent bce6799 commit 9bf3c9f

File tree

4 files changed

+85
-0
lines changed

4 files changed

+85
-0
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ configure.ac
2121
dev-notes/*
2222
revdep/*
2323

24+
^\.github$

.github/.gitignore

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

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

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
name: R-CMD-check
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: windows-latest, r: 'release'}
24+
- {os: macOS-latest, r: 'release'}
25+
# - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
26+
# - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
27+
28+
env:
29+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30+
RSPM: ${{ matrix.config.rspm }}
31+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- uses: r-lib/actions/setup-r@v1
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
40+
- uses: r-lib/actions/setup-pandoc@v1
41+
42+
- name: Query dependencies
43+
run: |
44+
install.packages('remotes')
45+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
46+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
47+
shell: Rscript {0}
48+
49+
- name: Cache R packages
50+
if: runner.os != 'Windows'
51+
uses: actions/cache@v2
52+
with:
53+
path: ${{ env.R_LIBS_USER }}
54+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
55+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
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 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
64+
65+
- name: Install dependencies
66+
run: |
67+
remotes::install_deps(dependencies = TRUE)
68+
remotes::install_cran("rcmdcheck")
69+
shell: Rscript {0}
70+
71+
- name: Check
72+
env:
73+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
74+
run: run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--ignore-vignettes"), build_args = c("--no-build-vignettes"), error_on = "warning", check_dir = "check")
75+
shell: Rscript {0}
76+
77+
- name: Upload check results
78+
if: failure()
79+
uses: actions/upload-artifact@main
80+
with:
81+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
82+
path: check

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<!-- badges: start -->
44
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/rstanarm?color=blue)](http://cran.r-project.org/package=rstanarm)
55
[![Downloads](http://cranlogs.r-pkg.org/badges/rstanarm?color=blue)](http://cran.rstudio.com/package=rstanarm)
6+
[![R-CMD-check](https://github.com/stan-dev/rstanarm/workflows/R-CMD-check/badge.svg)](https://github.com/stan-dev/rstanarm/actions)
67
<!-- badges: end -->
78

89
### Bayesian applied regression modeling (arm) via Stan

0 commit comments

Comments
 (0)