Skip to content

Commit c010106

Browse files
committed
feat: upgrade multiple github actions #133
1 parent 57df9a1 commit c010106

File tree

9 files changed

+215
-115
lines changed

9 files changed

+215
-115
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ appveyor.yml
1717
^Meta$
1818
^inst\examples$
1919
.git
20+
^\.github$

.github/.gitignore

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

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

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: R-CMD-check
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+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
41+
42+
- uses: r-lib/actions/setup-r-dependencies@v2
43+
with:
44+
extra-packages: any::rcmdcheck
45+
needs: check
46+
47+
- uses: r-lib/actions/check-r-package@v2
48+
with:
49+
upload-snapshots: true
50+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/R-check.yml

-44
This file was deleted.

.github/workflows/pr-commands.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
name: Commands
8+
9+
jobs:
10+
document:
11+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
12+
name: document
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: r-lib/actions/pr-fetch@v2
20+
with:
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- uses: r-lib/actions/setup-r@v2
24+
with:
25+
use-public-rspm: true
26+
27+
- uses: r-lib/actions/setup-r-dependencies@v2
28+
with:
29+
extra-packages: any::roxygen2
30+
needs: pr-document
31+
32+
- name: Document
33+
run: roxygen2::roxygenise()
34+
shell: Rscript {0}
35+
36+
- name: commit
37+
run: |
38+
git config --local user.name "$GITHUB_ACTOR"
39+
git config --local user.email "[email protected]"
40+
git add man/\* NAMESPACE
41+
git commit -m 'Document'
42+
43+
- uses: r-lib/actions/pr-push@v2
44+
with:
45+
repo-token: ${{ secrets.GITHUB_TOKEN }}
46+
47+
style:
48+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
49+
name: style
50+
runs-on: ubuntu-latest
51+
env:
52+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
53+
steps:
54+
- uses: actions/checkout@v4
55+
56+
- uses: r-lib/actions/pr-fetch@v2
57+
with:
58+
repo-token: ${{ secrets.GITHUB_TOKEN }}
59+
60+
- uses: r-lib/actions/setup-r@v2
61+
62+
- name: Install dependencies
63+
run: install.packages("styler")
64+
shell: Rscript {0}
65+
66+
- name: Style
67+
run: styler::style_pkg()
68+
shell: Rscript {0}
69+
70+
- name: commit
71+
run: |
72+
git config --local user.name "$GITHUB_ACTOR"
73+
git config --local user.email "[email protected]"
74+
git add \*.R
75+
git commit -m 'Style'
76+
77+
- uses: r-lib/actions/pr-push@v2
78+
with:
79+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
name: test-coverage
10+
11+
jobs:
12+
test-coverage:
13+
runs-on: ubuntu-latest
14+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: r-lib/actions/setup-r@v2
21+
with:
22+
use-public-rspm: true
23+
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
28+
29+
- name: Test coverage
30+
run: |
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
35+
)
36+
shell: Rscript {0}
37+
38+
- name: Show testthat output
39+
if: always()
40+
run: |
41+
## --------------------------------------------------------------------
42+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
44+
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ spellcheck:
4949
lint:
5050
${RSCRIPT} -e "devtools::lint()"
5151

52-
style:
53-
${RSCRIPT} -e "styler::style_pkg()"
54-
5552
revdep:
5653
${RSCRIPT} revdep/check.R
5754

README.Rmd

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@ knitr::opts_chunk$set(
99
message = FALSE
1010
)
1111
```
12-
12+
<!-- badges: start -->
1313
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
1414
[![R-check](https://github.com/ropensci/charlatan/workflows/R-check/badge.svg)](https://github.com/ropensci/charlatan/actions?query=workflow%3AR-check)
1515
[![cran checks](https://badges.cranchecks.info/worst/charlatan.svg)](https://cloud.r-project.org/web/checks/check_results_charlatan.html)
1616
[![cran status](https://www.r-pkg.org/badges/version/charlatan)](https://cran.r-project.org/package=charlatan)
1717
[![rstudio mirror downloads](https://cranlogs.r-pkg.org/badges/charlatan)](https://github.com/r-hub/cranlogs.app)
1818
[![](https://badges.ropensci.org/94_status.svg)](https://github.com/ropensci/software-review/issues/94)
19+
[![R-CMD-check](https://github.com/ropensci/charlatan/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/charlatan/actions/workflows/R-CMD-check.yaml)
20+
<!-- badges: end -->
21+
1922

2023
`charlatan` makes fake data, inspired from and borrowing some code from Python's faker (https://github.com/joke2k/faker)
2124

0 commit comments

Comments
 (0)