Skip to content

Commit 974b121

Browse files
committed
try setting up github actions
1 parent c32a39c commit 974b121

File tree

7 files changed

+87
-94
lines changed

7 files changed

+87
-94
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ vignettes/loo2-non-factorizable_cache/*
1616
^\.appveyor\.yml$
1717
^\.codecov\.yml$
1818
.github/*
19+
^\.github$

.appveyor.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.codecov.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

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

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: ${{ matrix.config.os }}
18+
19+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
config:
25+
- {os: windows-latest, r: 'release'}
26+
- {os: macOS-latest, r: 'release'}
27+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
29+
30+
env:
31+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32+
RSPM: ${{ matrix.config.rspm }}
33+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
- uses: r-lib/actions/setup-r@v1
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
42+
- uses: r-lib/actions/setup-pandoc@v1
43+
44+
- name: Query dependencies
45+
run: |
46+
install.packages('remotes')
47+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
49+
shell: Rscript {0}
50+
51+
- name: Cache R packages
52+
if: runner.os != 'Windows'
53+
uses: actions/cache@v2
54+
with:
55+
path: ${{ env.R_LIBS_USER }}
56+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
58+
59+
- name: Install system dependencies
60+
if: runner.os == 'Linux'
61+
run: |
62+
while read -r cmd
63+
do
64+
eval sudo $cmd
65+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
66+
67+
- name: Install dependencies
68+
run: |
69+
remotes::install_deps(dependencies = TRUE)
70+
remotes::install_cran("rcmdcheck")
71+
shell: Rscript {0}
72+
73+
- name: Check
74+
env:
75+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
76+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
77+
shell: Rscript {0}
78+
79+
- name: Upload check results
80+
if: failure()
81+
uses: actions/upload-artifact@main
82+
with:
83+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
84+
path: check

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/loo?color=blue)](https://cran.r-project.org/web/packages/loo)
55
[![RStudio_CRAN_mirror_downloads_badge](https://cranlogs.r-pkg.org/badges/loo?color=blue)](https://cran.r-project.org/web/packages/loo)
66
[![codecov](https://codecov.io/gh/stan-dev/loo/branch/master/graph/badge.svg)](https://codecov.io/github/stan-dev/loo?branch=master)
7-
[![Travis-CI Build Status](https://travis-ci.org/stan-dev/loo.svg?branch=master)](https://travis-ci.org/stan-dev/loo)
8-
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/stan-dev/loo?branch=master&svg=true)](https://ci.appveyor.com/project/jgabry/loo)
7+
[![R-CMD-check](https://github.com/stan-dev/loo/workflows/R-CMD-check/badge.svg)](https://github.com/stan-dev/loo/actions)
98
<!-- badges: end -->
109

1110
### Efficient approximate leave-one-out cross-validation for fitted Bayesian models

0 commit comments

Comments
 (0)