Skip to content

Commit f8f3d9c

Browse files
committed
added CI step
1 parent 4391559 commit f8f3d9c

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ $run_dev.*
99
^.here$
1010
^LICENSE\.md$
1111
^README\.Rmd$
12+
^\.github$

.github/.gitignore

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

.github/workflows/workflow.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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
3+
4+
# Name of the workflow
5+
name: CI-renv
6+
# Create status badge with usethis::use_github_actions_badge("ci-renv.yml")
7+
8+
on:
9+
# Triggered on push and pull request events
10+
push:
11+
pull_request:
12+
# Allow manual runs from the Actions tab
13+
workflow_dispatch:
14+
15+
jobs:
16+
CI-CD:
17+
runs-on: ${{ matrix.config.os }}
18+
19+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
20+
21+
strategy:
22+
# We keep a matrix for convenience, but we would typically just run on one
23+
# single OS and R version, aligned with the target deployment environment
24+
matrix:
25+
config:
26+
- {os: ubuntu-latest, r: 'renv'}
27+
28+
env:
29+
# Access token for GitHub
30+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
# Preserve package sources for informative references in case of errors
32+
R_KEEP_PKG_SOURCE: yes
33+
34+
steps:
35+
36+
- name: Checkout repo
37+
uses: actions/checkout@v4
38+
39+
- name: Setup R
40+
uses: r-lib/actions/setup-r@v2
41+
with:
42+
r-version: ${{ matrix.config.r }}
43+
# No RStudio Package Manager to respect renv.lock
44+
use-public-rspm: false
45+
46+
- name: Install system dependencies
47+
# This is not taken care of (yet) by r-lib/actions/setup-renv
48+
# See https://github.com/r-lib/actions/issues/785
49+
run: |
50+
# We rely on pkgdepends from the library embedded in pak
51+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/")
52+
install.packages("jsonlite")
53+
.libPaths(c(system.file("library", package = "pak"), .libPaths()))
54+
pkgdepends::new_pkg_installation_proposal(
55+
names(jsonlite::read_json("renv.lock")$Packages), config = list(dependencies = FALSE)
56+
)$solve()$install_sysreqs()
57+
shell: Rscript {0}
58+
59+
- name: Activate renv and restore packages with cache
60+
uses: r-lib/actions/setup-renv@v2
61+
62+
- name: Install R CMD check
63+
run: install.packages("rcmdcheck")
64+
shell: Rscript {0}
65+
66+
- name: Check package
67+
uses: r-lib/actions/check-r-package@v2

README.Rmd

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ knitr::opts_chunk$set(
1616
# shinyfaithful
1717

1818
<!-- badges: start -->
19+
[![workflow](https://github.com/guidomaggioorg/shinyfaithful/actions/workflows/workflow.yml/badge.svg)](https://github.com/guidomaggioorg/shinyfaithful/actions/workflows/workflow.yml)
1920
<!-- badges: end -->
2021

2122
The goal of shinyfaithful is to ...

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# shinyfaithful
55

66
<!-- badges: start -->
7+
8+
[![workflow](https://github.com/guidomaggioorg/shinyfaithful/actions/workflows/workflow.yml/badge.svg)](https://github.com/guidomaggioorg/shinyfaithful/actions/workflows/workflow.yml)
79
<!-- badges: end -->
810

911
The goal of shinyfaithful is to …

man/figures/README-pressure-1.png

6.05 KB
Loading

0 commit comments

Comments
 (0)