Skip to content

Commit 9e790ff

Browse files
Redirect pipeline output to data-release; GitHub Actions CI (DGEC); remove GitLab CI; add CODEOWNERS
1 parent d871e0e commit 9e790ff

9 files changed

Lines changed: 114 additions & 65 deletions

File tree

‎.Rbuildignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
^LICENSE$
88
^LICENSE\.md$
99
^DISCLAIMER\.md$
10-
^\.gitlab-ci\.yml$
1110
^Dockerfile$
1211
^code\.json$
1312
^CONTRIBUTING\.md$

‎.github/CODEOWNERS‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Code owners for multiDetectR.
2+
# Used by GitHub's "Require review from Code Owners" branch-protection setting
3+
# to enforce review before merge to main.
4+
#
5+
# Replace @DOI-USGS/multidetectr-maintainers with the actual GitHub team (or
6+
# individual @usernames) that should approve changes. A team must have write
7+
# access to the repository to be a valid code owner.
8+
9+
* @rerickson-usgs

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# GitHub Actions CI for multiDetectR (DGEC standards).
2+
#
3+
# Mirrors the previous GitLab pipeline: R CMD check (including vignettes) and
4+
# the testthat suite, on a public rocker/r-ver image.
5+
#
6+
# DGEC GitHub Actions conformance:
7+
# - Third-party actions are pinned to a full commit SHA (not a moving tag),
8+
# with the human-readable version in a trailing comment.
9+
# - GITHUB_TOKEN is granted the minimum permission (contents: read).
10+
# - No secrets are referenced; no self-hosted runners are used.
11+
name: R-CMD-check
12+
13+
on:
14+
push:
15+
branches: [main]
16+
pull_request:
17+
branches: [main]
18+
workflow_dispatch:
19+
20+
# Least-privilege token: the workflow only needs to read the repository.
21+
permissions:
22+
contents: read
23+
24+
jobs:
25+
R-CMD-check:
26+
runs-on: ubuntu-latest
27+
container:
28+
image: rocker/r-ver:4.6.1
29+
env:
30+
_R_CHECK_FORCE_SUGGESTS_: "false"
31+
_R_CHECK_NO_STOP_ON_TEST_ERROR_: "true"
32+
R_KEEP_PKG_SOURCE: "yes"
33+
steps:
34+
# actions/checkout@v4.2.2
35+
- name: Check out repository
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
37+
38+
- name: Install system dependencies
39+
run: |
40+
apt-get update -qq
41+
apt-get install -y --no-install-recommends \
42+
libcurl4-openssl-dev libssl-dev libxml2-dev pandoc git
43+
44+
- name: Install R package dependencies
45+
run: |
46+
Rscript -e 'install.packages(c("remotes", "rcmdcheck"), repos = "https://cloud.r-project.org", Ncpus = 4)'
47+
Rscript -e 'remotes::install_deps(dependencies = TRUE, upgrade = "never", Ncpus = 4)'
48+
Rscript -e 'need <- c("knitr", "rmarkdown", "rcmdcheck", "remotes", "shiny", "DT", "testthat"); miss <- need[!vapply(need, requireNamespace, logical(1), quietly = TRUE)]; if (length(miss)) stop(paste("missing packages", paste(miss, collapse = ", ")))'
49+
50+
- name: R CMD check
51+
run: |
52+
Rscript -e 'rcmdcheck::rcmdcheck(args = c("--no-manual"), error_on = "error", check_dir = "check")'
53+
54+
- name: Run testthat suite
55+
run: |
56+
Rscript -e 'testthat::test_local(stop_on_failure = TRUE)'
57+
58+
# actions/upload-artifact@v4.4.3
59+
- name: Upload check results
60+
if: always()
61+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
62+
with:
63+
name: r-cmd-check-results
64+
path: check/
65+
retention-days: 7

‎.gitlab-ci.yml‎

Lines changed: 0 additions & 59 deletions
This file was deleted.

‎data-raw/analysis/carp/R/fit_species_stan_2.R‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ fit_species_stan_2 <- function(all_species_data) {
77

88
rstan::rstan_options(threads_per_chain = 1)
99

10-
data_dir_out <- here::here("data-raw", "analysis", "carp", "data")
10+
# Write regenerated summaries to the data-release repo (output/), not the
11+
# package repo. Mirrors the MULTIDETECTR_DATA convention used by _targets.R.
12+
release_dir <- Sys.getenv(
13+
"MULTIDETECTR_DATA",
14+
unset = file.path(dirname(here::here()), "data-release")
15+
)
16+
data_dir_out <- file.path(release_dir, "output", "carp")
17+
dir.create(data_dir_out, recursive = TRUE, showWarnings = FALSE)
1118

1219
# Format data for occStan
1320
## take product to keep everything between 0 and 1

‎data-raw/analysis/carp/R/fit_species_stan_3.R‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ fit_species_stan_3 <- function(all_species_data) {
88

99
rstan::rstan_options(threads_per_chain = 1)
1010

11-
data_dir_out <- here::here("data-raw", "analysis", "carp", "data")
11+
# Write regenerated summaries to the data-release repo (output/), not the
12+
# package repo. Mirrors the MULTIDETECTR_DATA convention used by _targets.R.
13+
release_dir <- Sys.getenv(
14+
"MULTIDETECTR_DATA",
15+
unset = file.path(dirname(here::here()), "data-release")
16+
)
17+
data_dir_out <- file.path(release_dir, "output", "carp")
18+
dir.create(data_dir_out, recursive = TRUE, showWarnings = FALSE)
1219

1320
# Format data for occStan three-level model.
1421
#

‎data-raw/analysis/marine/R/fit_cw_2.R‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ fit_cw_2 <- function(marine_data, label) {
77

88
rstan::rstan_options(threads_per_chain = 1)
99

10-
data_dir_out <- here::here("data-raw", "analysis", "marine", "data")
10+
# Write regenerated summaries to the data-release repo (output/), not the
11+
# package repo. Mirrors the MULTIDETECTR_DATA convention used by _targets.R.
12+
release_dir <- Sys.getenv(
13+
"MULTIDETECTR_DATA",
14+
unset = file.path(dirname(here::here()), "data-release")
15+
)
16+
data_dir_out <- file.path(release_dir, "output", "marine")
17+
dir.create(data_dir_out, recursive = TRUE, showWarnings = FALSE)
1118

1219
# Two-level occupancy for one marker/subset: unit (Site) -> sample (Barcode
1320
# filter), collapsing PCR libraries to a single sample-level detection

‎data-raw/analysis/marine/R/fit_cw_3.R‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ fit_cw_3 <- function(marine_data, label) {
77

88
rstan::rstan_options(threads_per_chain = 1)
99

10-
data_dir_out <- here::here("data-raw", "analysis", "marine", "data")
10+
# Write regenerated summaries to the data-release repo (output/), not the
11+
# package repo. Mirrors the MULTIDETECTR_DATA convention used by _targets.R.
12+
release_dir <- Sys.getenv(
13+
"MULTIDETECTR_DATA",
14+
unset = file.path(dirname(here::here()), "data-release")
15+
)
16+
data_dir_out <- file.path(release_dir, "output", "marine")
17+
dir.create(data_dir_out, recursive = TRUE, showWarnings = FALSE)
1118

1219
# Three-level occupancy for one marker/subset of the Dryad release.
1320
# Levels: unit (Site) -> sample (Barcode filter) -> PCR library (K).

‎data-raw/analysis/marine/R/fit_richness_powerlaw.R‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
fit_richness_powerlaw <- function(richness_file, cost_grid, seed = 20260101) {
2-
data_dir_out <- here::here("data-raw", "analysis", "marine", "data")
2+
# Write the regenerated parameter table to the data-release repo (output/),
3+
# not the package repo. Mirrors the MULTIDETECTR_DATA convention in _targets.R.
4+
release_dir <- Sys.getenv(
5+
"MULTIDETECTR_DATA",
6+
unset = file.path(dirname(here::here()), "data-release")
7+
)
8+
data_dir_out <- file.path(release_dir, "output", "marine")
9+
dir.create(data_dir_out, recursive = TRUE, showWarnings = FALSE)
310
txt_dir <- here::here("data-raw", "analysis", "marine", "outputs")
411

512
X_sites <- N_samples <- K_subsamples <- richness <- #nolint

0 commit comments

Comments
 (0)