Skip to content

Commit 9146254

Browse files
Add GitHub Actions CI workflows to replace Travis CI
1 parent 6ef1f00 commit 9146254

4 files changed

Lines changed: 103 additions & 1 deletion

File tree

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
name: R-CMD-check
4+
5+
on:
6+
push:
7+
branches: [master]
8+
pull_request:
9+
branches: [master]
10+
11+
jobs:
12+
R-CMD-check:
13+
runs-on: ${{ matrix.config.os }}
14+
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: macOS-latest, r: 'release'}
22+
- {os: windows-latest, r: 'release'}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
27+
env:
28+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
29+
RSPM: ${{ matrix.config.rspm }}
30+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
name: test-coverage
3+
4+
on:
5+
push:
6+
branches: [master]
7+
pull_request:
8+
branches: [master]
9+
10+
jobs:
11+
test-coverage:
12+
runs-on: ubuntu-latest
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: r-lib/actions/setup-r@v2
20+
with:
21+
use-public-rspm: true
22+
23+
- uses: r-lib/actions/setup-r-dependencies@v2
24+
with:
25+
extra-packages: any::covr
26+
needs: coverage
27+
28+
- name: Test coverage
29+
run: |
30+
covr::codecov(
31+
quiet = FALSE,
32+
clean = FALSE,
33+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
34+
)
35+
shell: Rscript {0}
36+
37+
- name: Show testthat output
38+
if: always()
39+
run: |
40+
## Install package
41+
R CMD INSTALL .
42+
## Run tests
43+
Rscript -e 'testthat::test_package("networkD3")'
44+
shell: bash
45+
46+
- name: Upload test results
47+
if: failure()
48+
uses: actions/upload-artifact@v3
49+
with:
50+
name: coverage-test-failures
51+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ output: md_document
66

77
Development version: `r packageVersion("networkD3")`
88
[![CRAN Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3)
9+
[![R-CMD-check](https://github.com/christophergandrud/networkD3/workflows/R-CMD-check/badge.svg)](https://github.com/christophergandrud/networkD3/actions)
910
![CRAN Monthly Downloads](http://cranlogs.r-pkg.org/badges/last-month/networkD3)
1011
![CRAN Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/networkD3)
1112

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ D3 JavaScript Network Graphs from R
22
===================================
33

44
Development version: 0.4.9000 [![CRAN
5-
Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3) ![CRAN Monthly
5+
Version](http://www.r-pkg.org/badges/version/networkD3)](https://CRAN.R-project.org/package=networkD3) [![R-CMD-check](https://github.com/christophergandrud/networkD3/workflows/R-CMD-check/badge.svg)](https://github.com/christophergandrud/networkD3/actions) ![CRAN Monthly
66
Downloads](http://cranlogs.r-pkg.org/badges/last-month/networkD3) ![CRAN
77
Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/networkD3)
88

0 commit comments

Comments
 (0)