diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index f16b098..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -.github/workflows/* @cicdguy diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.yml b/.github/ISSUE_TEMPLATE/01_bug_report.yml deleted file mode 100644 index 5789012..0000000 --- a/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Bug Report -description: Something is not working correctly or is not working at all! -title: "Bug: " -labels: ["bug", "programming"] -assignees: - - octocat -body: - - type: markdown - attributes: - value: | - **Example:** Bug: rprofile() is returning NA values when using the config argument - - type: textarea - id: what-happened - attributes: - label: What happened? - description: Also tell us what were you expecting to happen before the bug? - placeholder: "A bug happened!" - validations: - required: true - - type: textarea - id: session-info - attributes: - label: Session Information - description: Use `sessionInfo()` in the R console to gather all the details of your environment when the bug happened. - placeholder: "Place the console output here" - validations: - required: false - - type: textarea - id: logs - attributes: - label: Reproducible Example - description: We love code that can reproduce the example. Check out [reprex](https://reprex.tidyverse.org/articles/reprex-dos-and-donts.html) - placeholder: "Please give us as many details as you can! The faster we can recreate the bug, the faster we can get a fix in the works. Warning, Error Messages and Screenshots are also great." - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.yml b/.github/ISSUE_TEMPLATE/02_feature_request.yml deleted file mode 100644 index 896e4dc..0000000 --- a/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Feature Request -description: Enchancement to admiral functionality -title: "Feature Request: " -labels: ["enhancement", "programming"] -assignees: - - octocat -body: - - type: markdown - attributes: - value: | - Thanks for taking the time to fill out this feature request! We love keeping envsetup fresh! - - type: textarea - id: feature - attributes: - label: Feature Idea - description: Tell us your idea in as few words as possible - placeholder: "`rprofile()` should do x, y and z" - validations: - required: true - - type: textarea - id: input - attributes: - label: Relevant Input - description: Can you provide what the inputs should look like? - placeholder: "What should the input look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" - validations: - required: false - - type: textarea - id: output - attributes: - label: Relevant Output - description: Can you provide what the final output should look like? - placeholder: "What should the output look like? REMINDER: no patient level data or company sensitive information should be shared via this open public issue" - validations: - required: false - - type: textarea - id: code - attributes: - label: Reproducible Example/Pseudo Code - description: Can you provide a working example or a sketch of how the code should work? - placeholder: "We love example code and it will speed up the process! REMINDER: no patient level data or company sensitive information should be shared via this open public issue" - validations: - required: false diff --git a/.github/ISSUE_TEMPLATE/03_docs_update.yml b/.github/ISSUE_TEMPLATE/03_docs_update.yml deleted file mode 100644 index 6241879..0000000 --- a/.github/ISSUE_TEMPLATE/03_docs_update.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Updates or Enhancements for Documentation -description: Documents out of date? Examples need reworking? Got an idea for a new article? -title: "Documentation: " -labels: ["vignettes", "website", "documentation"] -assignees: - - octocat -body: - - type: markdown - attributes: - value: | - The envsetup team loves documentation! Help us keep it up to date and fresh! - - type: dropdown - id: browsers - attributes: - label: Please select a category the issue is focused on? - multiple: true - options: - - Function Documentation - - User Guides - - Developer Guides - - Other - - I have a new documentation idea! Yay! - - type: textarea - id: docs-out-if-sync - attributes: - label: Let us know where something needs a refresh or put your idea here! - description: Screen shots are super helpful here! You can do a screenshot and cut and paste it here right in here. - placeholder: "Something is out of sync or needs a refresh" - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/06_general_issue.yml b/.github/ISSUE_TEMPLATE/06_general_issue.yml deleted file mode 100644 index ece0b2d..0000000 --- a/.github/ISSUE_TEMPLATE/06_general_issue.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: General Issue -description: Issue that is difficult to fit into bug, feature or documentation issue. -title: "General Issue: " -labels: ["general issue"] -assignees: - - octocat -body: - - type: markdown - attributes: - value: | - **Example:** General Issue: Linked In Blog Post for updates on the latest release? - - type: textarea - id: background - attributes: - label: Background Information - description: Please provide the context and purpose of this piece of work. Links and screenshots are encouraged. - placeholder: "Example: Use changelog/news.md file to gather relevant changes and create into a nice post for Linked In. The more information the better and the faster we can get this issue completed." - validations: - required: true - - type: textarea - id: done - attributes: - label: Definition of Done - description: Please define the deliverable or the desired outcome. - placeholder: "Example: All changes since last release are highlighted in Blog Post and posted to Linked In" - validations: - required: false diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index c911d69..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,17 +0,0 @@ -Thank you for your Pull Request! Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the codebase remains robust and consistent. - -Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the `devel` branch until you have checked off each task. - -- [ ] Place Closes # into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update) -- [ ] Code is formatted according to the [tidyverse style guide](https://style.tidyverse.org/). Run `styler::style_file()` to style R and Rmd files -- [ ] Updated relevant unit tests or have written new unit tests -- [ ] Update to all relevant roxygen headers and examples. -- [ ] Run `devtools::document()` so all `.Rd` files in the `man` folder and the `NAMESPACE` file in the project root are updated appropriately -- [ ] Address any updates needed for vignettes and/or templates -- [ ] Update `NEWS.md` if the changes pertain to a user-facing function (i.e. it has an `@export` tag) or documentation aimed at users (rather than developers) -- [ ] Build site `pkgdown::build_site()` and check that all affected examples are displayed correctly and that all new functions occur on the reference page. -- [ ] Address or fix all lintr warnings and errors - `lintr::lint_package()` -- [ ] Run `R CMD check` locally and address all errors and warnings - `devtools::check()` -- [ ] Link the issue so that it closes after successful merging. -- [ ] Address all merge conflicts and resolve appropriately. -- [ ] Pat yourself on the back for a job well done! Much love to your accomplishment! diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..e67cd75 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,59 @@ +# 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 + - dev + pull_request: + branches: + - main + - master + - dev + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: windows-latest, r: 'release'} + - {os: macOS-latest, r: 'release'} + - {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.posit.co/cran/__linux__/jammy/latest"} + - {os: ubuntu-22.04, r: 'devel', rspm: "https://packagemanager.posit.co/cran/__linux__/jammy/latest"} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + + 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")' \ No newline at end of file diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml deleted file mode 100644 index 334d3f2..0000000 --- a/.github/workflows/common.yml +++ /dev/null @@ -1,107 +0,0 @@ ---- -# Source: https://github.com/pharmaverse/admiralci -# Common workflows designed for Admiral -# but can be easily used by any other R package -name: Admiral Workflows - -on: - # 'workflow_dispatch' gives you the ability - # to run this workflow on demand, anytime - workflow_dispatch: - # 'push' events are triggered when commits - # are pushed to one of these branches - push: - branches: - - main - - devel - - pre-release - - test - # 'pull_request' events are triggered when PRs are - # created against one of these target branches. - pull_request: - branches: - - main - - devel - - pre-release - - test - # 'release' events are triggered when... - # you guessed it - when releases are made. - release: - types: [published] - schedule: - - cron: '21 13 * * 1,3,5' - -env: - # R version to use for the workflows - R_VERSION: "3.6" - -# Docs on concurrency: -# https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - group: admiral-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - style: - name: Code Style - uses: pharmaverse/admiralci/.github/workflows/style.yml@main - if: github.event_name == 'pull_request' - with: - r-version: $R_VERSION - spellcheck: - name: Spelling - uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main - if: github.event_name == 'pull_request' - with: - r-version: $R_VERSION - readme: - name: Render README - uses: pharmaverse/admiralci/.github/workflows/readme-render.yml@main - if: github.event_name == 'push' - with: - r-version: $R_VERSION - # This workflow autoformats the README.md file after - # it has been rendered. If you want to skip that, - # set the following value to 'true' - skip-md-formatting: false - check: - name: Check - uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main - if: github.event_name == 'pull_request' - with: - # Control how you want the errors to manifest - # by supplying the 'error_on' parameter to - # rcmdcheck::rcmdcheck() here. - error-on: error - docs: - name: Documentation - uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main - if: github.event_name == 'push' - with: - r-version: $R_VERSION - # Whether to skip multiversion docs - # Note that if you have multiple versions of docs, - # your URL links are likely to break due to path changes - skip-multiversion-docs: false - coverage: - name: Code Coverage - uses: pharmaverse/admiralci/.github/workflows/code-coverage.yml@main - if: > - github.event_name == 'push' || github.event_name == 'pull_request' - with: - r-version: $R_VERSION - # Whether to skip code coverage badge creation - # Setting to 'false' will require you to create - # an orphan branch called 'badges' in your repository - skip-coverage-badges: false - links: - name: Links - uses: pharmaverse/admiralci/.github/workflows/links.yml@main - if: > - github.event_name == 'push' || github.event_name == 'pull_request' - man-pages: - name: Man Pages - uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main - if: github.event_name == 'pull_request' - with: - r-version: $R_VERSION diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..bfc9f4d --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +# 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: + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +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 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 0000000..5e9a7e5 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,62 @@ +# 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: + +name: test-coverage.yaml + +permissions: read-all + +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, any::xml2 + needs: coverage + + - name: Test coverage + run: | + cov <- covr::package_coverage( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) + print(cov) + 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 + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package