Skip to content

Commit 34cdf5e

Browse files
committed
first commit
0 parents  commit 34cdf5e

File tree

149 files changed

+7970
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+7970
-0
lines changed

.Rbuildignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
^.*\.Rproj$
2+
^\.Rproj\.user$
3+
^README\.Rmd$
4+
^\.github$
5+
^_pkgdown\.yml$
6+
^docs$
7+
^pkgdown$
8+
^LICENSE\.md$

.github/.gitignore

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

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

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
permissions: read-all
12+
13+
jobs:
14+
R-CMD-check:
15+
runs-on: ${{ matrix.config.os }}
16+
17+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {os: macos-latest, r: 'release'}
24+
- {os: windows-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
28+
29+
env:
30+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
37+
38+
- uses: r-lib/actions/setup-r@v2
39+
with:
40+
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
43+
44+
- uses: r-lib/actions/setup-r-dependencies@v2
45+
with:
46+
extra-packages: any::rcmdcheck
47+
needs: check
48+
49+
- uses: r-lib/actions/check-r-package@v2
50+
with:
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'

.github/workflows/pkgdown.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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]
6+
release:
7+
types: [published]
8+
workflow_dispatch:
9+
10+
name: "Deploy pkgdown site to Posit Connect"
11+
12+
jobs:
13+
build-site:
14+
runs-on: ubuntu-latest
15+
steps:
16+
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup R
21+
uses: r-lib/actions/setup-r@v2
22+
with:
23+
r-version: 4.2.1
24+
25+
- name: Setup Pandoc
26+
uses: r-lib/actions/setup-pandoc@v2
27+
28+
- name: Install system dependencies
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install -y libxml2-dev libssl-dev libcurl4-openssl-dev
32+
33+
- name: Install R dependencies
34+
uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: |
37+
any::pkgdown
38+
any::rsconnect
39+
local::.
40+
41+
- name: Build site
42+
run: |
43+
Rscript -e "pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)"
44+
45+
- name: Deploy to GitHub Pages
46+
if: github.event_name != 'pull_request'
47+
uses: JamesIves/[email protected]
48+
with:
49+
clean: false
50+
branch: gh-pages
51+
folder: docs

.github/workflows/test-covbadge.yaml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
branches: [main]
6+
7+
name: test-coverage badge
8+
9+
permissions: write-all
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, any::xml2
27+
28+
- name: Test coverage
29+
run: |
30+
cov <- covr::package_coverage(
31+
quiet = FALSE,
32+
clean = FALSE,
33+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
34+
)
35+
# covr::to_cobertura(cov, file = "coverage.xml")
36+
coverage_percentage <- round(covr::percent_coverage(cov), 0)
37+
# Export the coverage percentage as an environment variable
38+
cat(sprintf("COVERAGE_PERCENTAGE=%s\n", coverage_percentage), file = Sys.getenv("GITHUB_ENV"), append = TRUE)
39+
shell: Rscript {0}
40+
41+
- name: Create Shields.io badge URL
42+
id: create_badge
43+
run: |
44+
coverage=$COVERAGE_PERCENTAGE
45+
if (( $(echo "${coverage} < 50" | bc -l) )); then
46+
color="red"
47+
elif (( $(echo "${coverage} < 80" | bc -l) )); then
48+
color="orange"
49+
else
50+
color="brightgreen"
51+
fi
52+
badge_url="https://img.shields.io/badge/coverage-${coverage}%25-${color}.svg"
53+
# Print the badge URL to the GitHub Actions log
54+
echo "Badge URL: ${badge_url}"
55+
# set badge
56+
echo "badge_url=${badge_url}" >> $GITHUB_ENV
57+
58+
- name: Update README with coverage badge for PR
59+
if: github.ref_name != 'main'
60+
run: |
61+
git config --global user.name 'github-actions'
62+
git config --global user.email '[email protected]'
63+
git checkout -b ${{ github.head_ref }}
64+
git branch
65+
git pull --rebase origin ${{ github.head_ref }}
66+
git checkout --ours README.md || true
67+
sed -i 's|!\[Coverage\](https://img.shields.io/badge/coverage-[0-9]*%25-[a-z]*\.svg)|![Coverage]('"${{ env.badge_url }}"')|g' README.md
68+
git status
69+
git add README.md
70+
git commit -m 'Update README with coverage badge' || echo "No changes to commit"
71+
git push origin ${{ github.head_ref }}
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Update README with coverage badge for main branch
76+
if: github.ref_name == 'main'
77+
run: |
78+
git config --global user.name 'github-actions'
79+
git config --global user.email '[email protected]'
80+
git checkout main
81+
git branch
82+
git pull --rebase origin main
83+
git checkout --ours README.md || true
84+
sed -i 's|!\[Coverage\](https://img.shields.io/badge/coverage-[0-9]*%25-[a-z]*\.svg)|![Coverage]('"${{ env.badge_url }}"')|g' README.md
85+
git status
86+
git add README.md
87+
git commit -m 'Update README with coverage badge' || echo "No changes to commit"
88+
git push origin main
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
4+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
name: test-coverage
13+
14+
permissions: write-all
15+
16+
jobs:
17+
test-coverage:
18+
runs-on: ubuntu-latest
19+
env:
20+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: r-lib/actions/setup-r@v2
26+
with:
27+
use-public-rspm: true
28+
29+
- uses: r-lib/actions/setup-r-dependencies@v2
30+
with:
31+
extra-packages: any::covr, any::xml2
32+
33+
- name: Test coverage
34+
run: |
35+
cov <- covr::package_coverage(
36+
quiet = FALSE,
37+
clean = FALSE,
38+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
39+
)
40+
covr::to_cobertura(cov, file = "coverage.xml")
41+
coverage_percentage <- round(covr::percent_coverage(cov), 0)
42+
writeLines(as.character(coverage_percentage), "coverage.txt")
43+
shell: Rscript {0}
44+
45+
- name: Show testthat output
46+
if: always()
47+
run: |
48+
## --------------------------------------------------------------------
49+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
50+
shell: bash
51+
52+
- name: Upload test results
53+
if: failure()
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: coverage-test-failures
57+
path: ${{ runner.temp }}/package
58+

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata
5+
inst/doc
6+
docs
7+

DESCRIPTION

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Package: risk.assessr
2+
Title: Assessing package risk metrics
3+
Version: 1.0.0
4+
Authors@R: c(
5+
person("Edward", "Gillian", , "[email protected]", role = c("cre", "aut"), comment = c(ORCID = "0000-0003-2732-5107")),
6+
person("Hugo", "Bottois", , "[email protected]", role = "aut", comment = c(ORCID = "0000-0003-4674-0875")),
7+
person("Paulin", "Charliquart", , "[email protected]", role = "aut"),
8+
person("Andre", "Couturier", , "[email protected]", role = "aut"),
9+
person("Sanofi", role = c("cph", "fnd"))
10+
)
11+
Description: Tools for assessing R packages against a number of metrics to help validate their trustworthiness and reliability.
12+
License: GPL (>= 2)
13+
Depends: R (>= 4.1.0)
14+
Imports: callr, checkmate, remotes, covr, devtools, dplyr, lubridate, purrr,
15+
rcmdcheck, rlang, httr2, jsonlite
16+
Suggests: forcats, fs, glue, here, knitr, magrittr, openxlsx,
17+
readr, roxygen2, pkgload, testthat (>= 3.0.0), stringr (>=
18+
1.4.0), tibble, tidyr, tidyselect, tools, rmarkdown, utils,
19+
withr, mockery
20+
Encoding: UTF-8
21+
RoxygenNote: 7.3.2
22+
Config/testthat/edition: 3
23+
Config/build/clean-inst-doc: false
24+
VignetteBuilder: knitr
25+
NeedsCompilation: no
26+
Packaged: 2024-09-24 15:02:32 UTC; u1004798
27+
Author: Edward Gillian [cre, aut],
28+
Hugo Bottois [aut]
29+
Maintainer: Edward Gillian <[email protected]>

0 commit comments

Comments
 (0)