Skip to content

Commit 79ec0a5

Browse files
committed
updating the gha
1 parent 13639a5 commit 79ec0a5

3 files changed

Lines changed: 52 additions & 75 deletions

File tree

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

Lines changed: 22 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
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
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches:
6-
- main
7-
- master
5+
branches: [main, master]
86
pull_request:
9-
branches:
10-
- main
11-
- master
127

13-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1411

1512
jobs:
1613
R-CMD-check:
@@ -22,69 +19,32 @@ jobs:
2219
fail-fast: false
2320
matrix:
2421
config:
22+
- {os: macos-latest, r: 'release'}
2523
- {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"}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
2926

3027
env:
31-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
RSPM: ${{ matrix.config.rspm }}
3328
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
3430

3531
steps:
36-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v4
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
3735

38-
- uses: r-lib/actions/setup-r@v1
36+
- uses: r-lib/actions/setup-r@v2
3937
with:
4038
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
4141

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: Restore R package cache
52-
if: runner.os != 'Windows'
53-
uses: actions/cache@v2
42+
- uses: r-lib/actions/setup-r-dependencies@v2
5443
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: |
77-
options(crayon.enabled = TRUE)
78-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
79-
shell: Rscript {0}
44+
extra-packages: any::rcmdcheck
45+
needs: check
8046

81-
- name: Upload check results
82-
if: failure()
83-
uses: actions/upload-artifact@main
47+
- uses: r-lib/actions/check-r-package@v2
8448
with:
85-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
86-
path: check
87-
88-
- name: Test coverage
89-
run: covr::codecov()
90-
shell: Rscript {0}
49+
upload-snapshots: true
50+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,49 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
55
branches: [main, master]
6-
tags: ['*']
6+
pull_request:
7+
release:
8+
types: [published]
9+
workflow_dispatch:
710

8-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
914

1015
jobs:
1116
pkgdown:
1217
runs-on: ubuntu-latest
18+
# Only restrict concurrency for non-PR jobs
19+
concurrency:
20+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1321
env:
1422
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
23+
permissions:
24+
contents: write
1525
steps:
16-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v4
1727

18-
- uses: r-lib/actions/setup-pandoc@master
28+
- uses: r-lib/actions/setup-pandoc@v2
1929

20-
- uses: r-lib/actions/setup-r@master
30+
- uses: r-lib/actions/setup-r@v2
2131
with:
2232
use-public-rspm: true
2333

24-
- uses: r-lib/actions/setup-r-dependencies@master
34+
- uses: r-lib/actions/setup-r-dependencies@v2
2535
with:
26-
extra-packages: pkgdown
36+
extra-packages: any::pkgdown, local::.
2737
needs: website
2838

29-
- name: Deploy package
30-
run: |
31-
git config --local user.name "$GITHUB_ACTOR"
32-
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
33-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
39+
- name: Build site
40+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
shell: Rscript {0}
42+
43+
- name: Deploy to GitHub pages 🚀
44+
if: github.event_name != 'pull_request'
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
46+
with:
47+
clean: false
48+
branch: gh-pages
49+
folder: docs

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ knitr::opts_chunk$set(
1919
[![R-CMD-check](https://github.com/medewitt/staninside/workflows/R-CMD-check/badge.svg)](https://github.com/medewitt/staninside/actions)
2020
[![Codecov test coverage](https://codecov.io/gh/medewitt/staninside/branch/main/graph/badge.svg)](https://codecov.io/gh/medewitt/staninside?branch=main)
2121
[![CRAN status](https://www.r-pkg.org/badges/version/staninside)](https://CRAN.R-project.org/package=staninside)
22+
[![R-CMD-check](https://github.com/medewitt/staninside/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/medewitt/staninside/actions/workflows/R-CMD-check.yaml)
2223
<!-- badges: end -->
2324

2425
The goal of staninside is to facilitate the use of [CmdStanR](https://mc-stan.org/cmdstanr/) and packages leveraging [Stan](https://mc-stan.org/) code.

0 commit comments

Comments
 (0)