Skip to content

Commit

Permalink
Update GitHub templates and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrerebeau committed May 9, 2021
1 parent c839852 commit e1fea90
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/CODE_OF_CONDUCT.md
Expand Up @@ -82,3 +82,4 @@ For answers to common questions about this code of conduct, see the FAQ at [http
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
@@ -1,6 +1,6 @@
# Contributing

This outlines how to propose a change to tabula. For more detailed info about contributing to this, and other tesselle packages, please see the [**development contributing guide**](https://www.tesselle.org/contributing.html).
This outlines how to propose a change to this package. For more detailed info about contributing to this, and other packages, please see the [**development contributing guide**](https://www.tesselle.org/contributing.html).

## Fixing typos

Expand All @@ -12,18 +12,18 @@ If you want to make a bigger change, it's a good idea to first file an issue and

### Pull request process

* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("tesselle/tabula", fork = TRUE)`.
* Fork the package and clone onto your computer. If you haven't done this before, we recommend using `usethis::create_from_github("tesselle/PACKAGE", fork = TRUE)`.
* Install all development dependencies with `devtools::install_dev_deps()`, and then make sure the package passes R CMD check by running `devtools::check()`. If R CMD check doesn't pass cleanly, it's a good idea to ask for help before continuing.
* Create a Git branch for your pull request (PR). We recommend using `usethis::pr_init("brief-description-of-change")`.
* Make your changes, commit to git, and then create a PR by running `usethis::pr_push()`, and following the prompts in your browser. The title of your PR should briefly describe the change. The body of your PR should contain `Fixes #issue-number`.
* For user-facing changes, add a bullet to the top of `NEWS.md` (i.e. just below the first header). Follow the style described in <https://style.tesselle.org>.

### Code style

* New code should follow the tesselle [style guide](https://style.tesselle.org).
* New code should follow the [style guide](https://style.tesselle.org).
* We use [roxygen2](https://cran.r-project.org/package=roxygen2), with [Markdown syntax](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd-formatting.html), for documentation.
* We use [testthat](https://cran.r-project.org/package=testthat) for unit tests. Contributions with test cases included are easier to accept.

## Code of Conduct

Please note that the tabula project is released with a [Contributor Code of Conduct](https://www.tesselle.org/conduct.html). By contributing to this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](https://www.tesselle.org/conduct.html). By contributing to this project you agree to abide by its terms.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
@@ -1,17 +1,15 @@
---
name: Bug report
about: Create a report to help us improve
about: Describe a bug you've seen
title: ''
labels: bug
assignees: nfrerebeau

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
A minimal reproducible example (AKA a reprex). If you've never heard of a [reprex](https://reprex.tidyverse.org/) before, start by reading <https://www.tidyverse.org/help/#reprex>.
A minimal reproducible example (AKA a reprex).

**Expected behavior**
A clear and concise description of what you expected to happen.
Expand All @@ -21,3 +19,4 @@ If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

6 changes: 2 additions & 4 deletions .github/ISSUE_TEMPLATE/custom.md
@@ -1,10 +1,8 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
name: Custom issue
about: Ask about a specific problem.
title: ''
labels: ''
assignees: ''

---


7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
@@ -1,14 +1,12 @@
---
name: Feature request
about: Suggest an idea for this project
about: Make a case for a new feature
title: ''
labels: enhancement
assignees: nfrerebeau

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand All @@ -18,3 +16,4 @@ A clear and concise description of any alternative solutions or features you've

**Additional context**
Add any other context or screenshots about the feature request here.

1 change: 1 addition & 0 deletions .github/pull_request_template.md
Expand Up @@ -18,3 +18,4 @@ methods/functions, include an example if possible to do in brief form -->

<!--- Did you remember to include tests? Unless you're just changing
grammar, please include new tests for your change -->

7 changes: 5 additions & 2 deletions .github/workflows/R-CMD-check.yaml
@@ -1,9 +1,11 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: R-CMD-check
Expand Down Expand Up @@ -32,9 +34,9 @@ jobs:
- {os: ubuntu-20.04, r: '3.3', vdiffr: false, xref: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# don't treat missing suggested packages as error
_R_CHECK_FORCE_SUGGESTS_: false
# Some packages might unavailable on the older versions, so let's ignore xref warnings
Expand All @@ -60,7 +62,7 @@ jobs:
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
- name: Restore R package cache
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -116,3 +118,4 @@ jobs:
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

92 changes: 92 additions & 0 deletions .github/workflows/drat.yaml
@@ -0,0 +1,92 @@
# https://github.com/r-hyperspec/hySpc.chondro/blob/develop/.github/workflows/drat--insert-package.yaml

on:
release:
types:
- published

name: drat

jobs:
drat:
runs-on: ubuntu-20.04

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.event.repository.name }}
RELEASE: ${{ github.event.release.tag_name }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages(c("pkgbuild", "drat"))
shell: Rscript {0}

- name: Build source package
run: |
dir.create("build", showWarnings = FALSE)
pkgbuild::build(dest_path = "build", binary = FALSE, vignettes = TRUE, manual = FALSE)
shell: Rscript {0}

- name: Configure git
# https://stackoverflow.com/a/60548651/633251
env:
TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
git config --global user.email "${REPO}@tesselle.org"
git config --global user.name "${REPO}"
- name: Clone tesselle/packages
if: success()
run: |
rm -rf tmp
git clone https://github.com/tesselle/packages.git tmp
- name: Insert package
if: success()
run: |
targz <- list.files(path = "build", pattern = "\\.tar\\.gz", full.names = TRUE)
drat::insertPackage(file = targz, repodir = "tmp", action = "archive", location = "docs")
shell: Rscript {0}

- name: Deploy
if: success()
run: |
cd tmp
git add *
# .tar.gz files are globally blocked (git ignored) by git,
# must add manually and force it
git add -f *.tar.gz
git commit -m "Add ${REPO} ${RELEASE}"
git push origin master
3 changes: 2 additions & 1 deletion .github/workflows/pkgdown.yaml
Expand Up @@ -25,7 +25,7 @@ jobs:
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
Expand All @@ -47,3 +47,4 @@ jobs:
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
3 changes: 2 additions & 1 deletion .github/workflows/test-coverage.yaml
Expand Up @@ -29,7 +29,7 @@ jobs:
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
- name: Restore R package cache
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
Expand All @@ -46,3 +46,4 @@ jobs:
- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

6 changes: 3 additions & 3 deletions README.Rmd
Expand Up @@ -35,9 +35,9 @@ knitr::opts_chunk$set(

An easy way to examine archaeological count data. **tabula** provides a convenient and reproducible toolkit for relative and absolute dating and analysis of (chronological) patterns. It includes functions for matrix seriation (reciprocal ranking, CA-based seriation), chronological modeling and dating of archaeological assemblages and/or objects. Beyond these, the package provides several tests and measures of diversity: heterogeneity and evenness (Brillouin, Shannon, Simpson, etc.), richness and rarefaction (Chao1, Chao2, ACE, ICE, etc.), turnover and similarity (Brainerd-Robinson, etc.). The package make it easy to visualize count data and statistical thresholds: rank vs. abundance plots, heatmaps, Ford (1962) and Bertin (1977) diagrams.

To cite **tabula** in publications please use:

> Frerebeau, N. (2019). tabula: An R Package for Analysis, Seriation, and Visualization of Archaeological Count Data. *Journal of Open Source Software*, 4(44), 1821. DOI [10.21105/joss.01821](https://doi.org/10.21105/joss.01821).
```{r citation, echo=FALSE}
utils::citation("tabula")
```

## Installation

Expand Down
25 changes: 19 additions & 6 deletions README.md
Expand Up @@ -40,12 +40,25 @@ and rarefaction (Chao1, Chao2, ACE, ICE, etc.), turnover and similarity
data and statistical thresholds: rank vs. abundance plots, heatmaps,
Ford (1962) and Bertin (1977) diagrams.

To cite **tabula** in publications please use:

> Frerebeau, N. (2019). tabula: An R Package for Analysis, Seriation,
> and Visualization of Archaeological Count Data. *Journal of Open
> Source Software*, 4(44), 1821. DOI
> [10.21105/joss.01821](https://doi.org/10.21105/joss.01821).
#>
#> To cite tabula in publications use:
#>
#> Frerebeau, Nicolas (2019). tabula: An R Package for Analysis,
#> Seriation, and Visualization of Archaeological Count Data. Journal of
#> Open Source Software, 4(44), 1821. DOI 10.21105/joss.01821.
#>
#> A BibTeX entry for LaTeX users is
#>
#> @Article{,
#> title = {{tabula}: An R Package for Analysis, Seriation, and Visualization of Archaeological Count Data},
#> author = {Nicolas Frerebeau},
#> year = {2019},
#> journal = {Journal of Open Source Software},
#> volume = {4},
#> number = {44},
#> page = {1821},
#> doi = {10.21105/joss.01821},
#> }

## Installation

Expand Down
7 changes: 2 additions & 5 deletions _pkgdown.yml
Expand Up @@ -31,9 +31,6 @@ reference:
- title: Getters and Setters
contents:
- has_concept("mutator")
- title: Data
contents:
- has_concept("datasets")

navbar:
type: default
Expand All @@ -55,5 +52,5 @@ navbar:
- text: Changelog
href: news/index.html
right:
- icon: fa-github fa-lg
href: https://github.com/nfrerebeau/tabula
- icon: fab fa-github fa-lg
href: https://github.com/tesselle/tabula

0 comments on commit e1fea90

Please sign in to comment.