Skip to content

Commit

Permalink
update mains functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim-Mane committed Sep 10, 2023
2 parents 9c7bc32 + eb55928 commit 91a460a
Show file tree
Hide file tree
Showing 210 changed files with 72,557 additions and 15,694 deletions.
Binary file removed .DS_Store
Binary file not shown.
Binary file removed .github/workflows/.DS_Store
Binary file not shown.
55 changes: 52 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +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
#
# Reproduce locally by running:
# ```r
# pak::pak(c("any::rcmdcheck", "."), dependencies = "Config/Needs/check")
# rcmdcheck::rcmdcheck()
# ```
on:
push:
branches: [main, master]
paths:
- 'data/**'
- 'R/**'
- 'inst/**'
- 'man/**'
- 'src/**'
- 'tests/**'
- 'vignettes/**'
- 'DESCRIPTION'
- 'NAMESPACE'
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'
pull_request:
branches: [main, master]
paths:
- 'data/**'
- 'R/**'
- 'inst/**'
- 'man/**'
- 'src/**'
- 'tests/**'
- 'vignettes/**'
- 'DESCRIPTION'
- 'NAMESPACE'
- 'LICENSE'
- '.Rbuildignore'
- '.github/workflows/R-CMD-check.yaml'

name: R-CMD-check

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -27,9 +62,11 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
# Exists since R 4.3.0 but `false` by default
_R_CHECK_LENGTH_COLON_: true

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

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

Expand All @@ -45,5 +82,17 @@ jobs:
needs: check

- uses: r-lib/actions/check-r-package@v2
id: rcmdcheck
with:
upload-snapshots: true
<<<<<<< HEAD
upload-snapshots: true
=======
upload-snapshots: true

# fail-fast but only if rcmdcheck step fails
- name: Manual fail-fast
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: always() && steps.rcmdcheck.outcome == 'failure'
run: gh run cancel ${{ github.run_id }}
>>>>>>> review
49 changes: 43 additions & 6 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
# 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
#
# Reproduce locally by running:
# ```r
# pak::pak(c("any::pkgdown", "."), dependencies = "Config/Needs/website")
# pkgdown::build_site()
# ```
on:
push:
branches: [main, master]
paths:
- 'README.Rmd'
- 'README.md'
- 'index.Rmd'
- 'index.md'
- 'man/**'
- 'vignettes/**'
- '_pkgdown.yml'
- 'pkgdown/**'
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
pull_request:
branches: [main, master]
paths:
- 'README.Rmd'
- 'README.md'
- 'index.Rmd'
- 'index.md'
- 'man/**'
- 'vignettes/**'
- '_pkgdown.yml'
- 'pkgdown/**'
- 'DESCRIPTION'
- '.Rbuildignore'
- '.github/**'
release:
types: [published]
workflow_dispatch:

name: pkgdown

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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@v2
- uses: actions/checkout@v3

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

Expand All @@ -41,6 +73,11 @@ jobs:
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
# We clean on releases because we want to remove old vignettes,
# figures, etc. that have been deleted from the `main` branch.
# But we clean ONLY on releases because we want to be able to keep
# both the 'stable' and 'dev' websites.
# Also discussed in https://github.com/r-lib/actions/issues/484
clean: ${{ github.event_name == 'release' }}
branch: gh-pages
folder: docs
63 changes: 58 additions & 5 deletions .github/workflows/render_readme.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
# Name of the workflow
# Reproduce locally by running:
# ```r
# pak::pak(c("any::rmarkdown", "any::usethis", "."))
# writeLines(
# knitr::knit_expand(
# "README.Rmd",
# packagename = read.dcf("DESCRIPTION", "Package"),
# gh_repo = usethis:::github_remote_list()$repo_spec
# ),
# "README_expanded.Rmd"
# )
# rmarkdown::render(
# "README_expanded.Rmd",
# output_file = "README.md",
# output_dir = "."
# )
# unlink("README_expanded.Rmd")
# ```
name: render-readme

# Controls when the action will run. Triggers include:
#
#
# - button trigger from github action page
# - on changes to readme.Rmd

Expand All @@ -11,16 +28,25 @@ on:
push:
paths:
- 'README.Rmd'
- '.github/workflows/render_readme.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
render-readme:
runs-on: macos-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
<<<<<<< HEAD
uses: actions/checkout@v2
=======
uses: actions/checkout@v3
>>>>>>> review

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand All @@ -29,11 +55,16 @@ jobs:

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
<<<<<<< HEAD

=======

>>>>>>> review
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.
<<<<<<< HEAD

- name: Compile the readme
run: |
Expand All @@ -47,8 +78,26 @@ jobs:
tf
)
rmarkdown::render(tf, output_file = "README.md", output_dir = ".")
=======

- name: Compile the readme
run: |
writeLines(
knitr::knit_expand(
"README.Rmd",
packagename = read.dcf("DESCRIPTION", "Package"),
gh_repo = Sys.getenv("GITHUB_REPOSITORY")
),
"README_expanded.Rmd"
)
rmarkdown::render(
"README_expanded.Rmd",
output_file = "README.md",
output_dir = "."
)
>>>>>>> review
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "[email protected]"
Expand All @@ -60,4 +109,8 @@ jobs:
git add man/figures/
fi
git diff-index --quiet HEAD || git commit -m "Automatic readme update"
git push origin || echo "No changes to push"
<<<<<<< HEAD
git push origin || echo "No changes to push"
=======
git push origin || echo "No changes to push"
>>>>>>> review
38 changes: 35 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
# 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
#
# Reproduce locally by running:
# ```r
# pak::pak("any::covr", dependencies = "Config/Needs/coverage")
# covr::codecov(quiet = FALSE)
# ```
on:
push:
branches: [main, master]
paths:
- 'R/**'
- 'src/**'
- 'tests/**'
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'
pull_request:
branches: [main, master]
paths:
- 'R/**'
- 'src/**'
- 'tests/**'
- 'inst/**'
- 'DESCRIPTION'
- '.github/workflows/test-coverage.yaml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

name: test-coverage

Expand All @@ -15,7 +38,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -28,4 +51,13 @@ jobs:

- name: Test coverage
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
<<<<<<< HEAD
shell: Rscript {0}
=======
shell: Rscript {0}

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
>>>>>>> review
55 changes: 55 additions & 0 deletions .github/workflows/update-citation-cff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# The action runs when:
# - A new release is published
# - The DESCRIPTION or inst/CITATION are modified
# - Can be run manually
# For customizing the triggers, visit https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
release:
types: [published]
push:
paths:
- DESCRIPTION
- inst/CITATION
- .github/workflows/update-citation-cff.yaml
workflow_dispatch:

name: Update CITATION.cff

jobs:
update-citation-cff:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::cffr
any::V8
- name: Update CITATION.cff
run: |
library(cffr)
# Customize with your own code
# See https://docs.ropensci.org/cffr/articles/cffr.html
# Write your own keys
mykeys <- list()
# Create your CITATION.cff file
cff_write(keys = mykeys)
shell: Rscript {0}

- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add CITATION.cff
git commit -m 'Update CITATION.cff' || echo "No changes to commit"
git push origin || echo "No changes to commit"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ docs
.Rproj.user
/doc/
/Meta/
.DS_Store
.Rhistory
/..Rcheck/
/Meta/
Loading

0 comments on commit 91a460a

Please sign in to comment.