Skip to content

Commit e197aa7

Browse files
authored
Merge pull request #164 from stan-dev/github-actions
GitHub actions
2 parents c32a39c + ddf8057 commit e197aa7

File tree

8 files changed

+198
-94
lines changed

8 files changed

+198
-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: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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+
if: "! contains(github.event.head_commit.message, '[ci skip]')"
16+
runs-on: ${{ matrix.config.os }}
17+
18+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
config:
24+
- {os: windows-latest, r: 'release'}
25+
- {os: macOS-latest, r: 'release'}
26+
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
27+
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28+
29+
env:
30+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
31+
RSPM: ${{ matrix.config.rspm }}
32+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- uses: r-lib/actions/setup-r@v1
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
41+
- uses: r-lib/actions/setup-pandoc@v1
42+
43+
- name: Query dependencies
44+
run: |
45+
install.packages('remotes')
46+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
47+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
48+
shell: Rscript {0}
49+
50+
- name: Cache R packages
51+
if: runner.os != 'Windows'
52+
uses: actions/cache@v2
53+
with:
54+
path: ${{ env.R_LIBS_USER }}
55+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
56+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
57+
58+
- name: Install system dependencies
59+
if: runner.os == 'Linux'
60+
run: |
61+
while read -r cmd
62+
do
63+
eval sudo $cmd
64+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
65+
66+
- name: Install dependencies
67+
run: |
68+
remotes::install_deps(dependencies = TRUE)
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+
sessioninfo::session_info(pkgs, include_base = TRUE)
77+
shell: Rscript {0}
78+
79+
- name: Check
80+
env:
81+
_R_CHECK_CRAN_INCOMING_: false
82+
_R_CHECK_FORCE_SUGGESTS_: false
83+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--ignore-vignettes"), build_args = c("--no-build-vignettes"), error_on = "warning", check_dir = "check")
84+
shell: Rscript {0}
85+
86+
- name: Show testthat output
87+
if: always()
88+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
89+
shell: bash
90+
91+
- name: Upload check results
92+
if: failure()
93+
uses: actions/upload-artifact@master
94+
with:
95+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
96+
path: check

.github/workflows/codecov.yaml

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+
9+
name: test-coverage
10+
11+
jobs:
12+
test-coverage-mac:
13+
name: "Mac"
14+
if: "! contains(github.event.head_commit.message, '[ci skip]')"
15+
runs-on: macOS-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: r-lib/actions/setup-r@master
22+
23+
- uses: r-lib/actions/setup-pandoc@master
24+
25+
- name: Query dependencies
26+
run: |
27+
install.packages('remotes')
28+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29+
shell: Rscript {0}
30+
31+
- name: Cache R packages
32+
uses: actions/cache@v1
33+
with:
34+
path: ${{ env.R_LIBS_USER }}
35+
key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
36+
restore-keys: macOS-r-4.0-1-
37+
38+
- name: Install dependencies
39+
run: |
40+
install.packages(c("remotes"))
41+
remotes::install_deps(dependencies = TRUE)
42+
remotes::install_cran("covr")
43+
shell: Rscript {0}
44+
45+
- name: Test coverage
46+
run: covr::codecov()
47+
shell: Rscript {0}
48+
49+
test-coverage-windows:
50+
name: "Windows"
51+
if: "! contains(github.event.head_commit.message, '[ci skip]')"
52+
runs-on: windows-latest
53+
env:
54+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
55+
steps:
56+
- uses: actions/checkout@v2
57+
58+
# - name: Set path for RTools 4.0
59+
# if: runner.os == 'Windows'
60+
# run: echo "C:/rtools40/usr/bin;C:/rtools40/mingw64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
61+
#
62+
# - name: Install mingw32-make and check toolchain path
63+
# if: runner.os == 'Windows'
64+
# run: |
65+
# pacman -Syu mingw-w64-x86_64-make --noconfirm
66+
# g++ --version
67+
# Get-Command g++ | Select-Object -ExpandProperty Definition
68+
# mingw32-make --version
69+
# Get-Command mingw32-make | Select-Object -ExpandProperty Definition
70+
# shell: powershell
71+
72+
- uses: r-lib/actions/setup-r@master
73+
with:
74+
r-version: 'release'
75+
76+
- uses: r-lib/actions/setup-pandoc@master
77+
78+
- name: Query dependencies
79+
run: |
80+
install.packages('remotes')
81+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
82+
shell: Rscript {0}
83+
84+
- name: Install dependencies
85+
run: |
86+
install.packages(c("remotes"))
87+
remotes::install_deps(dependencies = TRUE)
88+
remotes::install_cran("covr")
89+
shell: Rscript {0}
90+
91+
- name: Test coverage
92+
run: covr::codecov()
93+
shell: Rscript {0}
94+
95+
# - name: Test coverage
96+
# run: |
97+
# options(covr.gcov = 'C:/rtools40/mingw64/bin/gcov.exe');
98+
# covr::codecov(type = "all")
99+
# shell: Rscript {0}

.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)