Skip to content

Commit

Permalink
refresh package; fix #24; fix #25; fix #26; fix #28
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Jan 5, 2025
1 parent 8ba38cb commit 798fb16
Show file tree
Hide file tree
Showing 133 changed files with 1,274 additions and 3,569 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
^codecov\.yml$
^pkgdown$
^CRAN-SUBMISSION$
^README\.html$
^CODE_OF_CONDUCT\.md$
43 changes: 0 additions & 43 deletions .github/CONTRIBUTING.MD

This file was deleted.

32 changes: 32 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributing

## Bugs

* Submit an issue on the [issues page](https://github.com/rapidsurveys/bbw/issues)

## Code contributions

* Fork this repository to your Github account

* Clone your version on your account down to your machine from your account

```
git clone https://github.com/<yourgithubusername>/bbw.git
```

* Make sure to track progress upstream i.e., on our version of `bbw`
at `rapidsurveys/bbw`, by doing

```
git remote add upstream https://github.com/rapidsurveys/bbw.git
```

* Before making changes make sure to pull changes in from `upstream` by doing either `git fetch upstream` then merge later or `git pull upstream` to fetch and merge in one step

* Make your changes on a new feature branch

* Please write a test or tests for your changes if they affect code and not just documentation

* Push up changes to your account

* Submit a pull request at `rapidsurveys/bbw`
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -18,7 +19,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,18 +30,22 @@ jobs:
R_KEEP_PKG_SOURCE: yes

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

- uses: r-lib/actions/setup-pandoc@v1
- 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-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
53 changes: 53 additions & 0 deletions .github/workflows/netlify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
pull_request:
branches: [main, master]

name: pkgdown-pr

jobs:
netlify:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

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

- 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: Install package
run: R CMD INSTALL .

- name: Create website
run: |
pkgdown::build_site()
shell: Rscript {0}

- name: Create index file
run: |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;URL=/dev/index.html" /> <script language="javascript"> window.location.replace('/dev/index.html')</script></head></html>' > ./docs/index.html
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './docs'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
# these default to 'true'
enable-commit-comment: false
enable-github-deployment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
49 changes: 49 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
47 changes: 39 additions & 8 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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:
branches: [main, master]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
Expand All @@ -15,16 +16,46 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
/revdep/data.sqlite
/revdep/library
/revdep/library.noindex

README.html
/docs/
docs
13 changes: 7 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
Package: bbw
Type: Package
Title: Blocked Weighted Bootstrap
Version: 0.2.0
Version: 0.2.1.9000
Authors@R: c(
person("Mark", "Myatt", email = "[email protected]", role = "aut"),
person("Mark", "Myatt",
email = "[email protected]", role = c("aut", "cph")),
person("Ernest", "Guevarra", comment = c(ORCID = "0000-0002-4887-4415"),
email = "[email protected]", role = c("aut", "cre")))
email = "[email protected]", role = c("aut", "cre", "cph")))
Description: The blocked weighted bootstrap (BBW) is an estimation technique
for use with data from two-stage cluster sampled surveys in which either
prior weighting (e.g. population-proportional sampling or PPS as used in
Expand All @@ -17,22 +18,22 @@ Description: The blocked weighted bootstrap (BBW) is an estimation technique
<doi:10.1371/journal.pone.0163176> and Aaron et al (2016)
<doi:10.1371/journal.pone.0162462> for application of the blocked weighted
bootstrap to estimate indicators from two-stage cluster sampled surveys.
License: GPL-3
Depends: R (>= 3.0.1)
Imports:
car,
withr
Depends: R (>= 3.0.1)
Suggests:
knitr,
rmarkdown,
testthat,
spelling,
covr
License: GPL-3
Encoding: UTF-8
Language: en-GB
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.3.2
URL: https://github.com/rapidsurveys/bbw, https://rapidsurveys.io/bbw/
BugReports: https://github.com/rapidsurveys/bbw/issues
VignetteBuilder: knitr
Loading

0 comments on commit 798fb16

Please sign in to comment.