Skip to content

Commit

Permalink
update R-CMD-check and test-coverage workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
dchiu911 committed Jan 31, 2025
1 parent e89f244 commit 7dbd9e1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 23 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -29,7 +30,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand All @@ -41,11 +42,10 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, mixedClust=?ignore
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
env:
_R_CHECK_FORCE_SUGGESTS_: false
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
27 changes: 19 additions & 8 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
Expand All @@ -15,36 +16,46 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- 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, mixedClust=?ignore
extra-packages: any::covr, any::xml2
needs: coverage

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

- uses: codecov/codecov-action@v4
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

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

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ knitr::opts_chunk$set(

<!-- badges: start -->
[![R-CMD-check](https://github.com/AlineTalhouk/diceR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AlineTalhouk/diceR/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/AlineTalhouk/diceR/branch/master/graph/badge.svg)](https://app.codecov.io/gh/AlineTalhouk/diceR?branch=master)
[![Codecov test coverage](https://codecov.io/gh/AlineTalhouk/diceR/graph/badge.svg)](https://app.codecov.io/gh/AlineTalhouk/diceR)
[![CRAN status](https://www.r-pkg.org/badges/version/diceR)](https://CRAN.R-project.org/package=diceR)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/diceR?color=orange)](https://r-pkg.org/pkg/diceR)

<!-- badges: end -->

## Overview
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

[![R-CMD-check](https://github.com/AlineTalhouk/diceR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AlineTalhouk/diceR/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/AlineTalhouk/diceR/branch/master/graph/badge.svg)](https://app.codecov.io/gh/AlineTalhouk/diceR?branch=master)
coverage](https://codecov.io/gh/AlineTalhouk/diceR/graph/badge.svg)](https://app.codecov.io/gh/AlineTalhouk/diceR)
[![CRAN
status](https://www.r-pkg.org/badges/version/diceR)](https://CRAN.R-project.org/package=diceR)
[![CRAN RStudio mirror
downloads](https://cranlogs.r-pkg.org/badges/grand-total/diceR?color=orange)](https://r-pkg.org/pkg/diceR)

<!-- badges: end -->

## Overview
Expand Down Expand Up @@ -88,19 +89,24 @@ internal evaluation indices:
knitr::kable(obj$indices$ii$`4`)
```

| | Algorithms | calinski_harabasz | dunn | gamma | c_index | davies_bouldin | sd | s_dbw | silhouette | Compactness | Connectivity |
|:----------------|:----------------|------------------:|----------:|-----------:|----------:|---------------:|---------:|---------:|-----------:|------------:|-------------:|
| HC_Euclidean | HC_Euclidean | 3.104106 | 0.2608547 | 0.6349401 | 0.2844073 | 1.839182 | 2.846480 | 1.678968 | -0.1418603 | 24.83225 | 41.62183 |
| DIANA_Euclidean | DIANA_Euclidean | 53.647400 | 0.3348103 | -1.9749903 | 0.1589442 | 2.824201 | 3.450173 | 1.809561 | 0.0564065 | 21.93396 | 241.66310 |
| kmodes | kmodes | 55.138600 | 0.3396909 | -1.8704101 | 0.1453599 | 2.006752 | 3.986950 | 1.967467 | 0.1369288 | 21.91494 | 201.42540 |
| majority | majority | 19.373248 | 0.3544371 | 0.6529653 | 0.2102487 | 1.622799 | 4.039708 | 1.982210 | 0.1504666 | 23.85408 | 64.04921 |
| | Algorithms | calinski_harabasz | dunn | gamma | c_index | davies_bouldin | sd | s_dbw | silhouette | Compactness | Connectivity |
|:---|:---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| HC_Euclidean | HC_Euclidean | 3.104106 | 0.2608547 | 0.6349401 | 0.2844073 | 1.839182 | 2.846480 | 1.678968 | -0.1418603 | 24.83225 | 41.62183 |
| DIANA_Euclidean | DIANA_Euclidean | 53.647400 | 0.3348103 | -1.9749903 | 0.1589442 | 2.824201 | 3.450173 | 1.809561 | 0.0564065 | 21.93396 | 241.66310 |
| kmodes | kmodes | 55.138600 | 0.3396909 | -1.8704101 | 0.1453599 | 2.006752 | 3.986950 | 1.967467 | 0.1369288 | 21.91494 | 201.42540 |
| majority | majority | 19.373248 | 0.3544371 | 0.6529653 | 0.2102487 | 1.622799 | 4.039708 | 1.982210 | 0.1504666 | 23.85408 | 64.04921 |

## Pipeline

This figure is a visual schematic of the pipeline that `dice()`
implements.

![Ensemble Clustering pipeline.](man/figures/pipeline.png)
<figure>
<img src="man/figures/pipeline.png"
alt="Ensemble Clustering pipeline." />
<figcaption aria-hidden="true">Ensemble Clustering
pipeline.</figcaption>
</figure>

Please visit the
[overview](https://alinetalhouk.github.io/diceR/articles/overview.html "diceR overview")
Expand Down

0 comments on commit 7dbd9e1

Please sign in to comment.