diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index e558974..628e5ab 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -35,31 +35,48 @@ concurrency: group: admiral-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +env: + R_VERSION: "4.1" + jobs: + get_r_version: + name: Get R version + runs-on: ubuntu-latest + outputs: + r-version: ${{ steps.get_r_version.outputs.R_VERSION }} + steps: + - name: Get R Version for Downstream Container Jobs + id: get_r_version + run: echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT + shell: bash style: name: Code Style uses: pharmaverse/admiralci/.github/workflows/style.yml@main if: github.event_name == 'pull_request' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" spellcheck: name: Spelling uses: pharmaverse/admiralci/.github/workflows/spellcheck.yml@main if: github.event_name == 'pull_request' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" readme: name: Render README uses: pharmaverse/admiralci/.github/workflows/readme-render.yml@main if: github.event_name == 'push' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" validation: name: Validation uses: pharmaverse/admiralci/.github/workflows/r-pkg-validation.yml@main if: github.event_name == 'release' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" check: name: Check uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main @@ -68,8 +85,9 @@ jobs: name: Documentation uses: pharmaverse/admiralci/.github/workflows/pkgdown.yml@main if: github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v') + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.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 @@ -82,8 +100,9 @@ jobs: name: Lint uses: pharmaverse/admiralci/.github/workflows/lintr.yml@main if: github.event_name == 'pull_request' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" links: name: Links uses: pharmaverse/admiralci/.github/workflows/links.yml@main @@ -93,8 +112,9 @@ jobs: uses: pharmaverse/admiralci/.github/workflows/code-coverage.yml@main if: > github.event_name != 'release' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.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 @@ -103,5 +123,15 @@ jobs: name: Man Pages uses: pharmaverse/admiralci/.github/workflows/man-pages.yml@main if: github.event_name == 'pull_request' + needs: get_r_version with: - r-version: "4.1" + r-version: "${{ needs.get_r_version.outputs.r-version }}" + templates: + name: Check Templates + uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main + secrets: inherit + if: github.event.review.state == 'approved' + needs: get_r_version + with: + r-version: "${{ needs.get_r_version.outputs.r-version }}" + push-templates-data: true diff --git a/.github/workflows/templates.yml b/.github/workflows/templates.yml deleted file mode 100644 index 9abed5e..0000000 --- a/.github/workflows/templates.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Check Templates - -on: - workflow_dispatch: - pull_request_review: - types: [submitted] - -jobs: - templates: - name: Check Templates - uses: pharmaverse/admiralci/.github/workflows/check-templates.yml@main - if: github.event.review.state == 'approved' - with: - r-version: "4.1" diff --git a/NAMESPACE b/NAMESPACE index 6a743c3..c66dc2c 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,7 +8,6 @@ importFrom(admiraldev,assert_data_frame) importFrom(admiraldev,assert_filter_cond) importFrom(admiraldev,assert_logical_scalar) importFrom(admiraldev,assert_numeric_vector) -importFrom(admiraldev,assert_order_vars) importFrom(admiraldev,assert_symbol) importFrom(admiraldev,assert_vars) importFrom(dplyr,arrange) diff --git a/R/admiraltemplate-package.R b/R/admiraltemplate-package.R index c74eaf6..40f079b 100644 --- a/R/admiraltemplate-package.R +++ b/R/admiraltemplate-package.R @@ -27,5 +27,5 @@ #' @importFrom admiral derive_vars_dy #' @importFrom admiraldev assert_logical_scalar assert_character_vector assert_vars #' assert_data_frame assert_character_scalar assert_numeric_vector assert_filter_cond -#' assert_symbol assert_order_vars +#' assert_symbol "_PACKAGE" diff --git a/README.Rmd b/README.Rmd index df2d5c2..8d91477 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,7 +16,7 @@ dyn_link <- function(text, base_url, relative_url = "", # Change to TRUE when admiral adopts multiversion docs - is_multiversion = TRUE, + is_multiversion = FALSE, multiversion_default_ref = "main") { url <- paste(base_url, relative_url, sep = "/") if (is_multiversion) { diff --git a/README.md b/README.md index 6fb1716..71b7324 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ To be included as an `{admiral}` package extension we expect developers to adhere to the following standards: - [Code of - Conduct](https://pharmaverse.github.io/admiral/main/CODE_OF_CONDUCT.html) -- [Manifesto](https://pharmaverse.github.io/admiral/main/index.html?q=manifest#admiral-manifesto) + Conduct](https://pharmaverse.github.io/admiral/CODE_OF_CONDUCT.html) +- [Manifesto](https://pharmaverse.github.io/admiral/index.html?q=manifest#admiral-manifesto) - [Programming - Strategy](https://pharmaverse.github.io/admiraldev/main/articles/programming_strategy.html) + Strategy](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html) - [Development - Process](https://pharmaverse.github.io/admiraldev/main/articles/development_process.html) + Process](https://pharmaverse.github.io/admiraldev/articles/development_process.html) - Follow consistent workflow checks - A CRAN Release means 90% or greater test coverage @@ -116,7 +116,7 @@ strictly be followed in this sequence.* they should join using this [link](https://join.slack.com/t/pharmaverse/shared_invite/zt-yv5atkr4-Np2ytJ6W_QKz_4Olo7Jo9A)). All should read up on the admiral - [site](https://pharmaverse.github.io/admiral/main/), especially the + [site](https://pharmaverse.github.io/admiral/), especially the developer guides which all need to be followed for package extensions. 6. Optionally it can be useful to host a kick-off meeting to decide how @@ -183,10 +183,10 @@ strictly be followed in this sequence.* a common need for other TAs and if so consider instead raising an issue to `{admiral}` core. When designing new functions always try to stay aligned with the [programming - strategy.](https://pharmaverse.github.io/admiraldev/main/articles/programming_strategy.html). + strategy.](https://pharmaverse.github.io/admiraldev/articles/programming_strategy.html). 17. Start development of your foundational first release 0.1.0. Follow a consistent [development - process](https://pharmaverse.github.io/admiraldev/main/articles/development_process.html) + process](https://pharmaverse.github.io/admiraldev/articles/development_process.html) to `{admiral}`. 18. Line up testers from your companies and others and set expectations around when you believe a stable version would be available for user @@ -197,7 +197,7 @@ strictly be followed in this sequence.* pharmaverse council rep. 20. Raise an `{admiral}` repo issue to ensure your package extension site is linked from the core `{admiral}` site - [here.](https://pharmaverse.github.io/admiral/main/index.html#types-of-packages) + [here.](https://pharmaverse.github.io/admiral/index.html#types-of-packages) 21. It is important that the `{admiral}` family of packages keep to a similar release schedule and cadence, in order to ease adoption by our users and to give clear expectations. The `{admiral}` core @@ -215,7 +215,7 @@ strictly be followed in this sequence.* 23. Plan any future further enhancements and make issues. When your team feels ready you can open up to development contributions for these from the wider community - see [this - page.](https://pharmaverse.github.io/admiral/main/CONTRIBUTING.html#type-1-contribution-with-code). + page.](https://pharmaverse.github.io/admiral/CONTRIBUTING.html#type-1-contribution-with-code). Please use the *“good first issue”* (ideal for new starters) & *“help wanted”* (ideal for more experienced contributors) issue labels. @@ -239,7 +239,7 @@ contact us via slack if any issues arise. extension package is synced with other admiral packages 6. Update/Remove the following files to use your extension name: - `DESCRIPTION` File - Name, Authors - - `admiralext.Rproj` + - `admiraltemplate.Rproj` - `testthat.R` - `News.md` 7. Run `devtools::load_all()` and resolve issues @@ -248,11 +248,11 @@ contact us via slack if any issues arise. - Reach out to slack for help with creating a hex sticker/logo to replace pharmaverse logo 10. *Recommended*: Review the [documentation on the CI/CD - workflows](https://pharmaverse.github.io/admiralci/main/#what-these-workflows-do) + workflows](https://pharmaverse.github.io/admiralci/#what-these-workflows-do) for information about how to reuse the workflows from this template. Pay special attention to the section on creating the `badges` orphan branch in [this - section](https://pharmaverse.github.io/admiralci/main/#code-coverage). + section](https://pharmaverse.github.io/admiralci/#code-coverage). 11. Test out a dummy branch and do a Pull Request to ensure CI/CD works. 12. Any clearly dummy files like `R/my_first_fcn.R` or `inst/templates/ad_adxx.R` can be updated or removed.