Skip to content

Commit c13037a

Browse files
Merge pull request #82 from rsquaredacademy/develop
Migrations
2 parents 87207a9 + af2e5ab commit c13037a

File tree

116 files changed

+3266
-2597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3266
-2597
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches:
6-
- master
7-
- develop
5+
branches: [master, develop]
86
pull_request:
9-
branches:
10-
- master
11-
- develop
7+
branches: [master, develop]
128

13-
name: R-CMD-check
9+
name: R-CMD-check.yaml
10+
11+
permissions: read-all
1412

1513
jobs:
1614
R-CMD-check:
@@ -22,63 +20,33 @@ jobs:
2220
fail-fast: false
2321
matrix:
2422
config:
23+
- {os: macos-latest, r: 'release'}
2524
- {os: windows-latest, r: 'release'}
26-
- {os: macOS-latest, r: 'release'}
27-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
2928

3029
env:
31-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
RSPM: ${{ matrix.config.rspm }}
3330
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
3432

3533
steps:
36-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
3737

38-
- uses: r-lib/actions/setup-r@v1
38+
- uses: r-lib/actions/setup-r@v2
3939
with:
4040
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
4143

42-
- uses: r-lib/actions/setup-pandoc@v1
43-
44-
- name: Query dependencies
45-
run: |
46-
install.packages('remotes')
47-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
49-
shell: Rscript {0}
50-
51-
- name: Cache R packages
52-
if: runner.os != 'Windows'
53-
uses: actions/cache@v2
44+
- uses: r-lib/actions/setup-r-dependencies@v2
5445
with:
55-
path: ${{ env.R_LIBS_USER }}
56-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
58-
59-
- name: Install system dependencies
60-
if: runner.os == 'Linux'
61-
run: |
62-
while read -r cmd
63-
do
64-
eval sudo $cmd
65-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
66-
67-
- name: Install dependencies
68-
run: |
69-
remotes::install_deps(dependencies = TRUE)
70-
remotes::install_cran("rcmdcheck")
71-
shell: Rscript {0}
72-
73-
- name: Check
74-
env:
75-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
76-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
77-
shell: Rscript {0}
46+
extra-packages: any::rcmdcheck
47+
needs: check
7848

79-
- name: Upload check results
80-
if: failure()
81-
uses: actions/upload-artifact@main
49+
- uses: r-lib/actions/check-r-package@v2
8250
with:
83-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
84-
path: check
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/rhub.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
2+
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
3+
# You can update this file to a newer version using the rhub2 package:
4+
#
5+
# rhub::rhub_setup()
6+
#
7+
# It is unlikely that you need to modify this file manually.
8+
9+
name: R-hub
10+
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"
11+
12+
on:
13+
workflow_dispatch:
14+
inputs:
15+
config:
16+
description: 'A comma separated list of R-hub platforms to use.'
17+
type: string
18+
default: 'linux,windows,macos'
19+
name:
20+
description: 'Run name. You can leave this empty now.'
21+
type: string
22+
id:
23+
description: 'Unique ID. You can leave this empty now.'
24+
type: string
25+
26+
jobs:
27+
28+
setup:
29+
runs-on: ubuntu-latest
30+
outputs:
31+
containers: ${{ steps.rhub-setup.outputs.containers }}
32+
platforms: ${{ steps.rhub-setup.outputs.platforms }}
33+
34+
steps:
35+
# NO NEED TO CHECKOUT HERE
36+
- uses: r-hub/actions/setup@v1
37+
with:
38+
config: ${{ github.event.inputs.config }}
39+
id: rhub-setup
40+
41+
linux-containers:
42+
needs: setup
43+
if: ${{ needs.setup.outputs.containers != '[]' }}
44+
runs-on: ubuntu-latest
45+
name: ${{ matrix.config.label }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
config: ${{ fromJson(needs.setup.outputs.containers) }}
50+
container:
51+
image: ${{ matrix.config.container }}
52+
53+
steps:
54+
- uses: r-hub/actions/checkout@v1
55+
- uses: r-hub/actions/platform-info@v1
56+
with:
57+
token: ${{ secrets.RHUB_TOKEN }}
58+
job-config: ${{ matrix.config.job-config }}
59+
- uses: r-hub/actions/setup-deps@v1
60+
with:
61+
token: ${{ secrets.RHUB_TOKEN }}
62+
job-config: ${{ matrix.config.job-config }}
63+
- uses: r-hub/actions/run-check@v1
64+
with:
65+
token: ${{ secrets.RHUB_TOKEN }}
66+
job-config: ${{ matrix.config.job-config }}
67+
68+
other-platforms:
69+
needs: setup
70+
if: ${{ needs.setup.outputs.platforms != '[]' }}
71+
runs-on: ${{ matrix.config.os }}
72+
name: ${{ matrix.config.label }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
config: ${{ fromJson(needs.setup.outputs.platforms) }}
77+
78+
steps:
79+
- uses: r-hub/actions/checkout@v1
80+
- uses: r-hub/actions/setup-r@v1
81+
with:
82+
job-config: ${{ matrix.config.job-config }}
83+
token: ${{ secrets.RHUB_TOKEN }}
84+
- uses: r-hub/actions/platform-info@v1
85+
with:
86+
token: ${{ secrets.RHUB_TOKEN }}
87+
job-config: ${{ matrix.config.job-config }}
88+
- uses: r-hub/actions/setup-deps@v1
89+
with:
90+
job-config: ${{ matrix.config.job-config }}
91+
token: ${{ secrets.RHUB_TOKEN }}
92+
- uses: r-hub/actions/run-check@v1
93+
with:
94+
job-config: ${{ matrix.config.job-config }}
95+
token: ${{ secrets.RHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,61 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- master
5-
- develop
5+
branches: [master, develop]
66
pull_request:
7-
branches:
8-
- master
9-
- develop
7+
branches: [master, develop]
108

11-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1212

1313
jobs:
1414
test-coverage:
15-
runs-on: macOS-latest
15+
runs-on: ubuntu-latest
1616
env:
1717
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
1819
steps:
19-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2021

21-
- uses: r-lib/actions/setup-r@v1
22+
- uses: r-lib/actions/setup-r@v2
23+
with:
24+
use-public-rspm: true
2225

23-
- uses: r-lib/actions/setup-pandoc@v1
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
2430

25-
- name: Query dependencies
31+
- name: Test coverage
2632
run: |
27-
install.packages('remotes')
28-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
38+
covr::to_cobertura(cov)
3039
shell: Rscript {0}
3140

32-
- name: Cache R packages
33-
uses: actions/cache@v2
41+
- uses: codecov/codecov-action@v4
3442
with:
35-
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38-
39-
- name: Install dependencies
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
49+
- name: Show testthat output
50+
if: always()
4051
run: |
41-
install.packages(c("remotes"))
42-
remotes::install_deps(dependencies = TRUE)
43-
remotes::install_cran("covr")
44-
shell: Rscript {0}
52+
## --------------------------------------------------------------------
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
shell: bash
4555

46-
- name: Test coverage
47-
run: covr::codecov()
48-
shell: Rscript {0}
56+
- name: Upload test results
57+
if: failure()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: coverage-test-failures
61+
path: ${{ runner.temp }}/package

DESCRIPTION

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Depends:
1212
License: MIT + file LICENSE
1313
URL: https://rsquaredacademy.github.io/inferr/, https://github.com/rsquaredacademy/inferr
1414
BugReports: https://github.com/rsquaredacademy/inferr/issues
15-
Imports:
15+
Imports:
1616
data.table,
1717
magrittr,
1818
Rcpp,
@@ -22,10 +22,11 @@ Suggests:
2222
covr,
2323
knitr,
2424
rmarkdown,
25-
testthat,
25+
testthat (>= 3.0.0),
2626
xplorerr
2727
Encoding: UTF-8
2828
LazyData: true
2929
VignetteBuilder: knitr
30-
RoxygenNote: 7.1.1
30+
RoxygenNote: 7.3.2
3131
LinkingTo: Rcpp
32+
Config/testthat/edition: 3

0 commit comments

Comments
 (0)