Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non-runtime dependencies #8

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
95 changes: 23 additions & 72 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]
schedule:
- cron: '21 4 * * 0'
workflow_dispatch
- cron: "21 4 * * 0"
workflow_dispatch:

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -25,80 +23,33 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

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

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

- uses: r-lib/actions/setup-r@v1
- 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-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
extra-packages: any::rcmdcheck
needs: check

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: R CMD CHECK
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
CI: true
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: devtools::run_examples
env:
CI: true
run: |
devtools::run_examples(run_dontrun = TRUE)
shell: Rscript {0}

- name: devtools::test
env:
CI: true
run: |
devtools::test()
shell: Rscript {0}
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
62 changes: 30 additions & 32 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,46 @@
on:
push:
branches:
- main
- master
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

permissions: read-all

jobs:
pkgdown:
runs-on: macOS-latest
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: r-lib/actions/setup-r@v1
- uses: actions/checkout@v4

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Cache R packages
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE, run_dont_run = TRUE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
19 changes: 6 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: epigraphdb
Title: Interface Package for the 'EpiGraphDB' Platform
Version: 0.2.3
Version: 0.2.4
Authors@R: c(
person("Yi", "Liu", email = "[email protected]",
role = c("cre", "aut")
Expand All @@ -26,24 +26,14 @@ BugReports: https://github.com/MRCIEU/epigraphdb-r/issues
License: GPL-3
Suggests:
testthat,
roxygen2,
knitr,
rmarkdown,
spelling,
devtools,
usethis,
pkgdown,
styler,
lintr,
covr,
igraph,
gtools,
stringr,
dplyr,
ggplot2
dplyr
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.3.2
Imports:
magrittr,
tibble,
Expand All @@ -53,3 +43,6 @@ Imports:
jsonlite
VignetteBuilder: knitr
Language: en-GB
Config/Needs/build: devtools, lintr, styler, usethis, roxygen2
Config/Needs/coverage: covr
Config/Needs/website: pkgdown
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# epigraphdb 0.2.4

* Remove some non-runtime dependencies from the Imports and Suggests lists.

# epigraphdb 0.2.3 (2022-01-14)

- Error handling logics have been overhauled.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ To install the latest development version from github (
[`devtools`](https://devtools.r-lib.org/) is required
):
```r
# install.packages("devtools")
devtools::install_github("MRCIEU/epigraphdb-r")
# install.packages("remotes")
remotes::install_github("MRCIEU/epigraphdb-r")
```

To install a stable version from CRAN:
Expand Down
6 changes: 5 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# epigraphdb 0.2.4

This is a minor update, removing several unused and non-runtime dependencies from the Imports and Suggests fields of the DESCRIPTION file.

# epigraphdb 0.2.3

(2022-01-14 second submissioin)
(2022-01-14 second submission)
Fixed the issue of the package size too large.

(2022-01-14 first submissioin)
Expand Down
2 changes: 1 addition & 1 deletion man/epigraphdb-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading