Skip to content

Commit

Permalink
add actions to CMD-checks, coverage and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CorradoLanera committed May 2, 2024
1 parent 649bcfd commit 9597890
Show file tree
Hide file tree
Showing 17 changed files with 215 additions and 99 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^LICENSE\.md$
^CODE_OF_CONDUCT\.md$
^\.github$
^README\.Rmd$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
50 changes: 50 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
32 changes: 32 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: lint

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::lintr, local::.
needs: lint

- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 2 additions & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
linters: linters_with_defaults() # see vignette("lintr")
encoding: "UTF-8"
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions CrossClustering.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace,vignette

QuitChildProcessesOnExit: Yes
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# CrossClustering

[![Travis Build
Status](https://travis-ci.org/CorradoLanera/CrossClustering.svg?branch=develop)](https://travis-ci.org/CorradoLanera/CrossClustering)
[![AppVeyor Build
Status](https://ci.appveyor.com/api/projects/status/github/CorradoLanera/CrossClustering?branch=develop&svg=true)](https://ci.appveyor.com/project/CorradoLanera/CrossClustering)
<!-- badges: start -->

[![R-CMD-check](https://github.com/CorradoLanera/CrossClustering/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CorradoLanera/CrossClustering/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/CorradoLanera/CrossClustering/branch/master/graph/badge.svg)](https://app.codecov.io/gh/CorradoLanera/CrossClustering?branch=master)
[![lint](https://github.com/CorradoLanera/CrossClustering/actions/workflows/lint.yaml/badge.svg)](https://github.com/CorradoLanera/CrossClustering/actions/workflows/lint.yaml)
[![CRAN Status
Badge](http://www.r-pkg.org/badges/version/CrossClustering)](https://CRAN.R-project.org/package=CrossClustering)
[![Coverage
Status](https://codecov.io/gh/CorradoLanera/CrossClustering/branch/develop/graph/badge.svg)](https://codecov.io/gh/CorradoLanera/CrossClustering?branch=develop)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: end -->

CrossClustering is a partial clustering algorithm that combines the
Ward’s minimum variance and Complete Linkage algorithms, providing
Expand Down
12 changes: 6 additions & 6 deletions README.rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
output:
md_document:
variant: gfm
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand All @@ -16,11 +14,13 @@ knitr::opts_chunk$set(

# CrossClustering

[![Travis Build Status](https://travis-ci.org/CorradoLanera/CrossClustering.svg?branch=develop)](https://travis-ci.org/CorradoLanera/CrossClustering)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/CorradoLanera/CrossClustering?branch=develop&svg=true)](https://ci.appveyor.com/project/CorradoLanera/CrossClustering)
<!-- badges: start -->
[![R-CMD-check](https://github.com/CorradoLanera/CrossClustering/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/CorradoLanera/CrossClustering/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/CorradoLanera/CrossClustering/branch/master/graph/badge.svg)](https://app.codecov.io/gh/CorradoLanera/CrossClustering?branch=master)
[![lint](https://github.com/CorradoLanera/CrossClustering/actions/workflows/lint.yaml/badge.svg)](https://github.com/CorradoLanera/CrossClustering/actions/workflows/lint.yaml)
[![CRAN Status Badge](http://www.r-pkg.org/badges/version/CrossClustering)](https://CRAN.R-project.org/package=CrossClustering)
[![Coverage Status](https://codecov.io/gh/CorradoLanera/CrossClustering/branch/develop/graph/badge.svg)](https://codecov.io/gh/CorradoLanera/CrossClustering?branch=develop)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: end -->

CrossClustering is a partial clustering algorithm that combines the Ward's
minimum variance and Complete Linkage algorithms, providing automatic
Expand Down
45 changes: 0 additions & 45 deletions appveyor.yml

This file was deleted.

2 changes: 2 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ coverage:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
22 changes: 12 additions & 10 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Test environments
* local win 10 pro, R 3.5.1
* local win 11 edu, R 4.4.0

* ubuntu 14.04.5 LTS, and macOS Sierra 10.12.6 (on travis-ci);
both on R 3.4.4, R 3.5.0, and R under development (2018-06-20 r74923)
Expand All @@ -17,12 +17,14 @@ R CMD check results

R CMD check succeeded.


## Downstream dependencies
* devtools::revdep_check() results in no errors


## Resubmission
This is a resubmission. In this version I have:

* Removed the package name from the title.
## Re-submission
This is a re-submission, after the package has been removed from CRAN.
In this version I have:

* Replace all `{assertive}`'s functions calls to `{checkmate}`'s ones.
* Replace `{magrittr}`'s pipe instances with native pipe (updating
Dependencies)
* Overall general lint of source code
* Update the documentation format
* Switch from Travis and AppVeyor to GH-actions for CMD-checks, lint,
and coverage.
1 change: 1 addition & 0 deletions revdep/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ checks
library
checks.noindex
library.noindex
cloud.noindex
data.sqlite
*.html
Binary file removed revdep/checks.rds
Binary file not shown.
4 changes: 0 additions & 4 deletions revdep/email.yml

This file was deleted.

0 comments on commit 9597890

Please sign in to comment.