Skip to content

Commit 05a76cf

Browse files
ci: closes #118
1 parent 65cfda2 commit 05a76cf

File tree

4 files changed

+75
-100
lines changed

4 files changed

+75
-100
lines changed

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

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
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-
- master
7-
- develop
5+
branches: [master, develop]
86
pull_request:
9-
branches:
10-
- master
11-
- develop
7+
branches: [master, develop]
128

13-
name: R-CMD-check
9+
name: R-CMD-check.yaml
10+
11+
permissions: read-all
1412

1513
jobs:
1614
R-CMD-check:
@@ -22,63 +20,33 @@ jobs:
2220
fail-fast: false
2321
matrix:
2422
config:
23+
- {os: macos-latest, r: 'release'}
2524
- {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"}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
2928

3029
env:
31-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
RSPM: ${{ matrix.config.rspm }}
3330
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
3432

3533
steps:
36-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
3737

38-
- uses: r-lib/actions/setup-r@v1
38+
- uses: r-lib/actions/setup-r@v2
3939
with:
4040
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
4143

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
44+
- uses: r-lib/actions/setup-r-dependencies@v2
5445
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}
46+
extra-packages: any::rcmdcheck
47+
needs: check
7848

79-
- name: Upload check results
80-
if: failure()
81-
uses: actions/upload-artifact@main
49+
- uses: r-lib/actions/check-r-package@v2
8250
with:
83-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
84-
path: check
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/test-coverage.yaml

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,61 @@
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
13
on:
24
push:
3-
branches:
4-
- master
5-
- develop
5+
branches: [master, develop]
66
pull_request:
7-
branches:
8-
- master
9-
- develop
7+
branches: [master, develop]
108

11-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1212

1313
jobs:
1414
test-coverage:
15-
runs-on: macOS-latest
15+
runs-on: ubuntu-latest
1616
env:
1717
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
1819
steps:
19-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2021

21-
- uses: r-lib/actions/setup-r@v1
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
2225

23-
- uses: r-lib/actions/setup-pandoc@v1
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
2430

25-
- name: Query dependencies
31+
- name: Test coverage
2632
run: |
27-
install.packages('remotes')
28-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
covr::to_cobertura(cov)
3039
shell: Rscript {0}
3140

32-
- name: Cache R packages
33-
uses: actions/cache@v2
41+
- uses: codecov/codecov-action@v4
3442
with:
35-
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38-
39-
- name: Install dependencies
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
4051
run: |
41-
install.packages(c("remotes"))
42-
remotes::install_deps(dependencies = TRUE)
43-
remotes::install_cran("covr")
44-
shell: Rscript {0}
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
4555

46-
- name: Test coverage
47-
run: covr::codecov()
48-
shell: Rscript {0}
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ options(tibble.width = Inf)
1818
> Tools for building binary logistic regression models
1919
2020
<!-- badges: start -->
21-
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/blorr)](https://cran.r-project.org/package=blorr) [![cran checks](https://cranchecks.info/badges/summary/blorr)](https://cran.r-project.org/web/checks/check_results_blorr.html) ![r-universe](https://rsquaredacademy.r-universe.dev/badges/blorr)
22-
[![R build status](https://github.com/rsquaredacademy/blorr/workflows/R-CMD-check/badge.svg)](https://github.com/rsquaredacademy/blorr/actions) [![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
23-
[![Coverage status](https://codecov.io/gh/rsquaredacademy/blorr/branch/master/graph/badge.svg)](https://codecov.io/github/rsquaredacademy/blorr?branch=master) [![status](https://tinyverse.netlify.com/badge/blorr)](https://CRAN.R-project.org/package=blorr) [![](https://cranlogs.r-pkg.org/badges/grand-total/blorr)](https://cran.r-project.org/package=blorr)
21+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/blorr)](https://cran.r-project.org/package=blorr)
22+
[![R-CMD-check](https://github.com/rsquaredacademy/blorr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rsquaredacademy/blorr/actions/workflows/R-CMD-check.yaml)
23+
[![Coverage status](https://codecov.io/gh/rsquaredacademy/blorr/branch/master/graph/badge.svg)](https://codecov.io/github/rsquaredacademy/blorr?branch=master)
24+
2425
<!-- badges: end -->
2526

2627
## Overview

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@
77
88
<!-- badges: start -->
99

10-
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/blorr)](https://cran.r-project.org/package=blorr)
11-
[![cran
12-
checks](https://cranchecks.info/badges/summary/blorr)](https://cran.r-project.org/web/checks/check_results_blorr.html)
13-
![r-universe](https://rsquaredacademy.r-universe.dev/badges/blorr) [![R
14-
build
15-
status](https://github.com/rsquaredacademy/blorr/workflows/R-CMD-check/badge.svg)](https://github.com/rsquaredacademy/blorr/actions)
16-
[![Lifecycle:
17-
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
10+
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/blorr)](https://cran.r-project.org/package=blorr)
11+
[![R-CMD-check](https://github.com/rsquaredacademy/blorr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rsquaredacademy/blorr/actions/workflows/R-CMD-check.yaml)
1812
[![Coverage
1913
status](https://codecov.io/gh/rsquaredacademy/blorr/branch/master/graph/badge.svg)](https://codecov.io/github/rsquaredacademy/blorr?branch=master)
20-
[![status](https://tinyverse.netlify.com/badge/blorr)](https://CRAN.R-project.org/package=blorr)
21-
[![](https://cranlogs.r-pkg.org/badges/grand-total/blorr)](https://cran.r-project.org/package=blorr)
14+
2215
<!-- badges: end -->
2316

2417
## Overview
@@ -45,8 +38,8 @@ install.packages("blorr", repos = "https://rsquaredacademy.r-universe.dev")
4538

4639
## Articles
4740

48-
- [A Short Introduction to the blorr
49-
Package](https://blorr.rsquaredacademy.com/articles/introduction.html)
41+
- [A Short Introduction to the blorr
42+
Package](https://blorr.rsquaredacademy.com/articles/introduction.html)
5043

5144
## Usage
5245

0 commit comments

Comments
 (0)