Skip to content

Commit a9a0a10

Browse files
authored
Merge pull request #8 from ThinkR-open/fix-names-extra
new unit tests and CI
2 parents 18641ce + 8bc4ead commit a9a0a10

File tree

12 files changed

+246
-139
lines changed

12 files changed

+246
-139
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
^CODE_OF_CONDUCT\.md$
1212
^data-raw$
1313
^gitdown$
14+
^\.github$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

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

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: ${{ matrix.config.os }}
18+
19+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
config:
25+
- {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"}
29+
30+
env:
31+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32+
RSPM: ${{ matrix.config.rspm }}
33+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
34+
35+
steps:
36+
- uses: actions/checkout@v2
37+
38+
- uses: r-lib/actions/setup-r@v1
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
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
54+
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}
80+
81+
- name: Upload check results
82+
if: failure()
83+
uses: actions/upload-artifact@main
84+
with:
85+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
86+
path: check

.github/workflows/pkgdown.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
7+
name: pkgdown
8+
9+
jobs:
10+
pkgdown:
11+
runs-on: macOS-latest
12+
env:
13+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- uses: r-lib/actions/setup-r@v1
18+
19+
- uses: r-lib/actions/setup-pandoc@v1
20+
21+
- name: Query dependencies
22+
run: |
23+
install.packages('remotes')
24+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
25+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
26+
shell: Rscript {0}
27+
28+
- name: Cache R packages
29+
uses: actions/cache@v2
30+
with:
31+
path: ${{ env.R_LIBS_USER }}
32+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
33+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34+
35+
- name: Install dependencies
36+
run: |
37+
remotes::install_deps(dependencies = TRUE)
38+
install.packages("pkgdown", type = "binary")
39+
shell: Rscript {0}
40+
41+
- name: Install package
42+
run: R CMD INSTALL .
43+
44+
- name: Deploy package
45+
run: |
46+
git config --local user.email "actions@github.com"
47+
git config --local user.name "GitHub Actions"
48+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

.github/workflows/test-coverage.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
pull_request:
7+
branches:
8+
- main
9+
- master
10+
11+
name: test-coverage
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: macOS-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: r-lib/actions/setup-r@v1
22+
23+
- uses: r-lib/actions/setup-pandoc@v1
24+
25+
- name: Query dependencies
26+
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")
30+
shell: Rscript {0}
31+
32+
- name: Cache R packages
33+
uses: actions/cache@v2
34+
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
40+
run: |
41+
install.packages(c("remotes"))
42+
remotes::install_deps(dependencies = TRUE)
43+
remotes::install_cran("covr")
44+
shell: Rscript {0}
45+
46+
- name: Test coverage
47+
run: covr::codecov()
48+
shell: Rscript {0}

.travis.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Authors@R:
1515
person(given = "ThinkR",
1616
role = "cph"),
1717
person(given = "Institut de Recherches Internationales Servier",
18-
role = c("spn")))
18+
role = "spn"))
1919
Description: Read all commit messages and sort them according to
2020
tags or specific text pattern.
2121
License: MIT + file LICENSE
@@ -43,4 +43,4 @@ VignetteBuilder:
4343
knitr
4444
Encoding: UTF-8
4545
LazyData: true
46-
RoxygenNote: 7.1.0
46+
RoxygenNote: 7.1.1

README.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ file.copy(list.files("reference/figures", full.names = TRUE),
2424
# gitdown <img src="man/figures/logo.png" align="right" alt="" width="120" />
2525

2626
<!-- badges: start -->
27-
[![Travis build status](https://travis-ci.org/ThinkR-open/gitdown.svg?branch=master)](https://travis-ci.org/ThinkR-open/gitdown)
2827
[![Coverage status](https://codecov.io/gh/ThinkR-open/gitdown/branch/master/graph/badge.svg)](https://codecov.io/github/ThinkR-open/gitdown?branch=master)
29-
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/ThinkR-open/gitdown?branch=master&svg=true)](https://ci.appveyor.com/project/ThinkR-open/gitdown)
28+
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/gitdown/actions)
3029
<!-- badges: end -->
3130

3231
The goal of {gitdown} is to build a bookdown report of commit messages arranged according to a pattern. Book can be organised according to git tags, issues mentionned (*e.g.* `#123`) or any custom character chain included in your git commit messages (*e.g.* `category_` for use like `category_ui`, `category_doc`, ...).

README.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55

66
<!-- badges: start -->
77

8-
[![Travis build
9-
status](https://travis-ci.org/ThinkR-open/gitdown.svg?branch=master)](https://travis-ci.org/ThinkR-open/gitdown)
108
[![Coverage
119
status](https://codecov.io/gh/ThinkR-open/gitdown/branch/master/graph/badge.svg)](https://codecov.io/github/ThinkR-open/gitdown?branch=master)
12-
[![AppVeyor build
13-
status](https://ci.appveyor.com/api/projects/status/github/ThinkR-open/gitdown?branch=master&svg=true)](https://ci.appveyor.com/project/ThinkR-open/gitdown)
10+
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/gitdown/actions)
1411
<!-- badges: end -->
1512

1613
The goal of {gitdown} is to build a bookdown report of commit messages
@@ -50,13 +47,13 @@ get_commits_pattern(repo, pattern = "#[[:digit:]]+", ref = "master") %>%
5047
#> # A tibble: 7 x 12
5148
#> pattern.content sha summary message author email when order
5249
#> <chr> <chr> <chr> <chr> <chr> <chr> <dttm> <int>
53-
#> 1 #32 7945… Add NE… "Add N… Alice alic… 2020-09-09 13:06:00 4
54-
#> 2 #1 7945… Add NE… "Add N… Alice alic… 2020-09-09 13:06:00 4
55-
#> 3 #12 7945… Add NE… "Add N… Alice alic… 2020-09-09 13:06:00 4
56-
#> 4 #2 94c7… Third … "Third… Alice alic… 2020-09-09 13:06:00 3
57-
#> 5 #145 94c7… Third … "Third… Alice alic… 2020-09-09 13:06:00 3
58-
#> 6 #1 3ae8… exampl… "examp… Alice alic… 2020-09-09 13:06:00 2
59-
#> 7 <NA> 8a91… First … "First… Alice alic… 2020-09-09 13:06:00 1
50+
#> 1 #32 03f7… Add NE… "Add N… Alice alic… 2021-03-04 18:26:32 4
51+
#> 2 #1 03f7… Add NE… "Add N… Alice alic… 2021-03-04 18:26:32 4
52+
#> 3 #12 03f7… Add NE… "Add N… Alice alic… 2021-03-04 18:26:32 4
53+
#> 4 #2 e7c9… Third … "Third… Alice alic… 2021-03-04 18:26:32 3
54+
#> 5 #145 e7c9… Third … "Third… Alice alic… 2021-03-04 18:26:32 3
55+
#> 6 #1 a02f… exampl… "examp… Alice alic… 2021-03-04 18:26:32 2
56+
#> 7 <NA> 8fcf… First … "First… Alice alic… 2021-03-04 18:26:32 1
6057
#> # … with 4 more variables: tag.name <chr>, tag.message <chr>,
6158
#> # pattern.type <chr>, pattern.title <chr>
6259
```
@@ -75,18 +72,18 @@ get_commits_pattern(
7572
#> # A tibble: 12 x 12
7673
#> pattern.type pattern.content sha summary message author email
7774
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
78-
#> 1 Tickets ticket6789 7945… Add NE… "Add N… Alice alic…
79-
#> 2 Tickets ticket1234 7945… Add NE… "Add N… Alice alic…
80-
#> 3 Issues #32 7945… Add NE… "Add N… Alice alic…
81-
#> 4 Issues #1 7945… Add NE… "Add N… Alice alic…
82-
#> 5 Issues #12 7945… Add NE… "Add N… Alice alic…
83-
#> 6 Tickets <NA> 94c7… Third … "Third… Alice alic…
84-
#> 7 Issues #2 94c7… Third … "Third… Alice alic…
85-
#> 8 Issues #145 94c7… Third … "Third… Alice alic…
86-
#> 9 Tickets ticket1234 3ae8… exampl… "examp… Alice alic…
87-
#> 10 Issues #1 3ae8… exampl… "examp… Alice alic…
88-
#> 11 Tickets <NA> 8a91… First … "First… Alice alic…
89-
#> 12 Issues <NA> 8a91… First … "First… Alice alic…
75+
#> 1 Tickets ticket6789 03f7… Add NE… "Add N… Alice alic…
76+
#> 2 Tickets ticket1234 03f7… Add NE… "Add N… Alice alic…
77+
#> 3 Issues #32 03f7… Add NE… "Add N… Alice alic…
78+
#> 4 Issues #1 03f7… Add NE… "Add N… Alice alic…
79+
#> 5 Issues #12 03f7… Add NE… "Add N… Alice alic…
80+
#> 6 Tickets <NA> e7c9… Third … "Third… Alice alic…
81+
#> 7 Issues #2 e7c9… Third … "Third… Alice alic…
82+
#> 8 Issues #145 e7c9… Third … "Third… Alice alic…
83+
#> 9 Tickets ticket1234 a02f… exampl… "examp… Alice alic…
84+
#> 10 Issues #1 a02f… exampl… "examp… Alice alic…
85+
#> 11 Tickets <NA> 8fcf… First … "First… Alice alic…
86+
#> 12 Issues <NA> 8fcf… First … "First… Alice alic…
9087
#> # … with 5 more variables: when <dttm>, order <int>, tag.name <chr>,
9188
#> # tag.message <chr>, pattern.title <chr>
9289
```
@@ -137,10 +134,10 @@ create_vignette_last_modif(repo_pkg, path = "")
137134
With this example, the vignette will show this content:
138135

139136
| File | Tracked in git | Date of creation | Last modification |
140-
| :----------- | :------------- | :------------------ | :------------------ |
141-
| NEWS.md | Yes | 2020-09-09 15:06:00 | 2020-09-09 15:06:00 |
142-
| example.txt | Yes | 2020-09-09 15:06:00 | 2020-09-09 15:06:00 |
143-
| R/my\_mean.R | No | NA | 2020-09-09 15:06:00 |
137+
|:-------------|:---------------|:--------------------|:--------------------|
138+
| NEWS.md | Yes | 2021-03-04 19:26:33 | 2021-03-04 19:26:33 |
139+
| example.txt | Yes | 2021-03-04 19:26:33 | 2021-03-04 19:26:33 |
140+
| R/my\_mean.R | No | NA | 2021-03-04 19:26:33 |
144141

145142
## Sponsor
146143

appveyor.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)