Skip to content

Commit

Permalink
Merge pull request #69 from pharmaverse/refactor_rversion
Browse files Browse the repository at this point in the history
Refactor rversion
  • Loading branch information
bms63 authored Nov 6, 2023
2 parents 6b518fd + 123fcc5 commit 780cb97
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 38 deletions.
46 changes: 38 additions & 8 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
15 changes: 0 additions & 15 deletions .github/workflows/templates.yml

This file was deleted.

1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion R/admiraltemplate-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 780cb97

Please sign in to comment.