From 190ab71b1e13d0dbfa331558644ec11d2f701dae Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Fri, 4 Feb 2022 21:20:43 +0200 Subject: [PATCH] Squashed commit of the following: commit 14e112c23d49ad94699627f3baaff11731a2221f Author: Sam Abbott Date: Fri Feb 4 15:50:18 2022 +0000 add github to vscode tools for dev environmenth commit a851c753dd3e0ce58b5043497afd27d5503eeb46 Author: Sam Abbott Date: Fri Feb 4 15:43:07 2022 +0000 switch to preferably template for website --- .devcontainer/devcontainer.json | 3 +- .github/workflows/pkgdown.yaml | 53 +++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 4 +-- DESCRIPTION | 4 ++- NEWS.md | 1 + 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6717a1de..66b4b139 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,7 +21,8 @@ "shan.code-settings-sync", "searking.preview-vscode", "tht13.html-preview-vscode", - "formulahendry.code-runner" + "formulahendry.code-runner", + "github.vscode-pull-request-github" ], // Use 'forwardPorts' to make a list of ports inside the container available locally. diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..8d695bc1 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,53 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + tags: ['*'] + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: n1hility/cancel-previous-runs@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v2 + - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-r@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: Restore R package cache + uses: actions/cache@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: | + install.packages(c("remotes", "curl")) + remotes::install_deps(dependencies = TRUE) + remotes::install_github("r-lib/pkgdown") + remotes::install_github("amirmasoudabdol/preferably", type = "source") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 008fa328..f35a2100 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ # R specific hooks: https://github.com/lorenzwalthert/precommit repos: - repo: https://github.com/lorenzwalthert/precommit - rev: v0.1.3.9014 + rev: v0.2.2.9009 hooks: - id: style-files args: [--style_pkg=styler, --style_fun=tidyverse_style] @@ -45,7 +45,7 @@ repos: - id: no-browser-statement - id: deps-in-desc - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 + rev: v4.1.0 hooks: - id: check-added-large-files args: ['--maxkb=800'] diff --git a/DESCRIPTION b/DESCRIPTION index 91b47f8e..2acdb0e3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -107,7 +107,6 @@ Suggests: ggspatial, knitr, mockery, - pkgdown, rmarkdown, RSocrata, rvest, @@ -119,6 +118,9 @@ Suggests: VignetteBuilder: knitr Config/testthat/edition: 3 +Config/Needs/website: + r-lib/pkgdown, + amirmasoudabdol/preferably Encoding: UTF-8 Language: en-gb LazyData: true diff --git a/NEWS.md b/NEWS.md index 4a270315..16faffd2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,7 @@ This release is currently under development * Change the data source for Switzerland to draw data from the Swiss Federal Office of Public Health (FOPH) * Updated the package logo to include the newly supported data sets. * Reduced the number of package dependencies (@bisaloo and @RichardMN) + ## Bug fixes - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk).