Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
aeeb22e
ci: install HTML Tidy before R CMD check (#73)
mcanouil Sep 27, 2026
7b12607
test: add offline GSE270837 and GSE178516 fixtures (#74)
mcanouil Sep 27, 2026
7bc6166
refactor: raise classed cli conditions (#76)
mcanouil Sep 28, 2026
56f2259
feat: introduce the S7 nacho class and accessors (#77)
mcanouil Sep 28, 2026
402c212
perf: rewrite the RCC parser and QC on matrices (#78)
mcanouil Sep 28, 2026
f53adf6
feat: read saved objects and upgrade NACHO 2 objects (#80)
mcanouil Sep 28, 2026
f536bc4
feat: convert to and from SummarizedExperiment (#81)
mcanouil Sep 28, 2026
843e050
ci: refresh apt lists before installing tidy (#83)
mcanouil Sep 29, 2026
698d7e5
fix: keep inner pipe fields in RCC probe names (#84)
mcanouil Sep 29, 2026
2478440
fix: point NACHO 2 objects to upgrade_nacho() (#85)
mcanouil Sep 29, 2026
2e47189
refactor: tidy internals and data-raw installs (#87)
mcanouil Sep 29, 2026
1fe9456
test: tighten PlexSet and validator assertions (#88)
mcanouil Sep 29, 2026
7fa4eaa
fix: accept open thresholds and warn once (#86)
mcanouil Sep 29, 2026
69c58d8
docs: add breaking changes and tidy internal docs (#89)
mcanouil Sep 30, 2026
dba60d9
Merge remote-tracking branch 'origin/main' into feat/nacho-3
mcanouil Sep 30, 2026
dd0965a
feat: add background thresholding and unrounded output (#92)
mcanouil Oct 1, 2026
ab5ae78
feat: add threshold presets and a per-metric QC table (#93)
mcanouil Oct 1, 2026
737c05e
feat: add detection rates and the RNA content flag (#94)
mcanouil Oct 1, 2026
59c37e2
feat: rank housekeeping genes by geNorm and NormFinder stability (#97)
mcanouil Oct 2, 2026
ff546ac
feat: add RUVg normalisation and suggest_ruv_k() (#98)
mcanouil Oct 2, 2026
26dfdea
feat: support miRNA panels with their own normalisation and QC (#99)
mcanouil Oct 2, 2026
eed3feb
feat: make GLM normalisation robust, with a fallback to GEO (#101)
mcanouil Oct 2, 2026
d7889f3
feat: add batch and confounding diagnostics (#102)
mcanouil Oct 2, 2026
a14fc44
Merge remote-tracking branch 'origin/main' into feat/nacho-3
mcanouil Oct 2, 2026
2fdeec8
fix: name the calling function in background errors (#103)
mcanouil Oct 2, 2026
8eb3fb7
fix: guard Phase 2 helpers against very small data (#104)
mcanouil Oct 3, 2026
1eb3612
test: tighten Phase 2 assertions (#105)
mcanouil Oct 3, 2026
4986af2
refactor: tidy Phase 2 internals (#106)
mcanouil Oct 3, 2026
8b69fa7
feat: add the NACHO brand, fonts and plot theme (#107)
mcanouil Oct 4, 2026
527e3a1
feat: render the report with Quarto (#108)
mcanouil Oct 4, 2026
57fdd80
test: skip GEO download tests when NCBI fails (#110)
mcanouil Oct 4, 2026
b596d6f
feat: rebuild the app as nacho_app() with modules (#111)
mcanouil Oct 5, 2026
94e7e20
feat: rebuild the app interface with bslib (#112)
mcanouil Oct 5, 2026
57f5880
docs: theme the website from the NACHO brand file (#114)
mcanouil Oct 5, 2026
7285baf
feat: add interactive plots, linked sample selection and an export pa…
mcanouil Oct 6, 2026
271ad82
test: drive the app in a browser and audit its accessibility (#116)
mcanouil Oct 6, 2026
f77b2d5
feat: add a summary strip, a Help menu and plots that fill their card…
mcanouil Oct 8, 2026
236e455
fix: stop the selection loop that quick clicks started in the app (#119)
mcanouil Oct 8, 2026
e206ef2
perf: build the app's plots in parallel and look up fonts once (#120)
mcanouil Oct 8, 2026
70072d2
feat: redesign the report as a quality-control record in HTML and PDF…
mcanouil Oct 9, 2026
b74c181
docs: add an app tutorial and regenerate the app screenshots (#124)
mcanouil Oct 9, 2026
000673a
fix: keep plot worker callbacks to their own pool (#125)
mcanouil Oct 9, 2026
bdd3a53
test: skip slow app and report tests on CRAN (#126)
mcanouil Oct 9, 2026
5a4248c
fix: keep the batch factor panel titles readable (#127)
mcanouil Oct 10, 2026
07679e3
perf: draw the large static plots faster (#128)
mcanouil Oct 10, 2026
b331839
fix: build plots in the app when a plot worker stops (#130)
mcanouil Oct 10, 2026
89adbcf
fix: return focus to the Help menu only after the cite dialog (#131)
mcanouil Oct 10, 2026
a79cc1f
ci: fix gaps in the release pipeline (#133)
mcanouil Oct 10, 2026
ef40603
test: keep files of child processes out of the check temp folder (#134)
mcanouil Oct 10, 2026
ccd2c3f
docs: rewrite the vignettes and README for NACHO 3 (#136)
mcanouil Oct 11, 2026
be96322
docs: add a guide for moving from NACHO 2 (#137)
mcanouil Oct 11, 2026
69746b3
chore: update package version to 2.0.8.9000
mcanouil Oct 11, 2026
fd05b50
docs: show the quality-control report in a website article (#140)
mcanouil Oct 11, 2026
7a298c2
fix: keep generated images in their own colours in dark mode (#141)
mcanouil Oct 12, 2026
b2cae97
docs: redesign the website home page (#142)
mcanouil Oct 13, 2026
f6d120a
chore: add docs directory to .gitignore
mcanouil Oct 13, 2026
70a82ca
fix: warn when positive controls are unusable
mcanouil Oct 13, 2026
e6bc6c1
fix: warn when sample sheet columns are replaced
mcanouil Oct 13, 2026
1d69219
refactor: compute only PC batch R² for the plot
mcanouil Oct 13, 2026
0ebdcbd
fix: tighten PCL and positive control warnings
mcanouil Oct 13, 2026
db69901
test: add GSE346526 fixture from nSolver 4.0.1.8
mcanouil Oct 13, 2026
bf4a419
feat: explain Ligation_NEG failures in whole blood
mcanouil Oct 13, 2026
eb6c993
fix: keep app uploads inside the upload folder
mcanouil Oct 13, 2026
598d440
fix: refuse an id column with a computed name
mcanouil Oct 13, 2026
57c22e5
ci: run R-hub on the release bump branch
mcanouil Oct 13, 2026
ffe7df8
fix: refuse housekeeping genes that are not probes
mcanouil Oct 14, 2026
c757189
style: format with air
mcanouil Oct 14, 2026
58d44d5
test: compare upload paths after normalising them
mcanouil Oct 14, 2026
46ce71f
feat: read and write thresholds as YAML (#143)
mcanouil Oct 14, 2026
328e174
feat: add a guided tour to the app (#144)
mcanouil Oct 14, 2026
9b96030
feat: import RCC files in the background (#145)
mcanouil Oct 15, 2026
4e6e5e9
feat: preview the upload before import (#146)
mcanouil Oct 15, 2026
88b3c48
feat: export an R script that reproduces the app (#149)
mcanouil Oct 15, 2026
b6f11ec
feat: one sortable table on the Samples page (#148)
mcanouil Oct 15, 2026
2467458
docs: polish the NACHO 3 changelog [skip ci]
mcanouil Oct 15, 2026
6f2bccb
docs: list only changes since 2.0.8 in the changelog [skip ci]
mcanouil Oct 15, 2026
44ea673
fix: mark the selected sample with a rose ring
mcanouil Oct 15, 2026
f6e2981
docs: refresh the app screenshots and animation
mcanouil Oct 15, 2026
62ff2fd
fix: refuse an id column named like a quality-control column
mcanouil Oct 15, 2026
082bdf4
docs: load the miRNA example with the SPRINT limits
mcanouil Oct 15, 2026
561c7dd
feat: open one sidebar section for each page
mcanouil Oct 18, 2026
93d8c03
docs: show the whole sidebar in the app screenshots
mcanouil Oct 18, 2026
03c15ab
refactor: let the thresholds module open its panel
mcanouil Oct 18, 2026
7a8a8ea
docs: reopen only Imaging for the vignette picture
mcanouil Oct 18, 2026
b5cdaf0
test: spell out the panel each page opens
mcanouil Oct 18, 2026
5d0fdfe
test: check each page panel exists in the sidebar
mcanouil Oct 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
^CRAN-SUBMISSION$
^revdep$
^README\.Rmd$
^man/figures/README-nacho_app\.gif$
^man/figures/README-.*\.gif$
^LICENSE\.md$
^data-raw$
^vignettes/articles$
^\.superpowers$
^\.kata\.toml$
^\.ruff_cache$
^\.roborev$
\.DS_Store$
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ body:
- Data import (`load_rcc()`)
- Normalisation (`normalise()`)
- Plots (`autoplot()`)
- Outliers (`check_outliers()`)
- Quality control (`nacho_qc()`)
- Report (`render()`)
- Deployment (`deploy()`)
- Other
Expand Down
11 changes: 10 additions & 1 deletion .github/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@ The checks still run on `main`, and the submission workflow checks the tarball a
Tick "rhub" to run the R-hub checks as well.
They're optional, and `cran-comments.md` only lists them when they run.

Untick "auto-merge" when `cran-comments.md` needs a note, for example to explain breaking changes.
Untick "auto-merge" when `cran-comments.md` needs a note, for example to explain breaking changes or a NOTE you expect from the check.
The pull request is then assigned to you: edit the file on it and merge it yourself.

## 2. Submit to CRAN

Merging the bump starts the "CRAN submission" workflow.
It builds the tarball with the PDF manual and runs `R CMD check --as-cran`.

The workflow then compares the check with the results line of `cran-comments.md`, for example `0 errors | 0 warnings | 1 note`.
It stops before the upload only if `cran-comments.md` reports fewer errors, warnings or notes than the check found.
A file that reports more problems than the check found passes.
The check step before it already stops on any WARNING or ERROR, so the workflow lists only the NOTE sections that the file must explain.
Open a pull request that explains each NOTE in `cran-comments.md` and corrects the results line, merge it, then run "CRAN submission" by hand from `main` with "dry run" unticked.

It then waits for your approval on the `cran` environment.
Approve it, and the workflow uploads the tarball and records the submission in `CRAN-SUBMISSION` on `main`.
CRAN then emails the maintainer, and the submission only counts once you click the link in that email.
Expand Down Expand Up @@ -50,10 +56,13 @@ Once CRAN's acceptance email arrives, run the "CRAN post-release" workflow from

It checks that CRAN serves the version, tags `vX.Y.Z` on the submitted commit, and publishes the "NACHO X.Y.Z" release with the notes from `NEWS.md`.
The release deploys the pkgdown site.
A draft release `vX.Y.Z` stops the run, so publish or delete it before you run the workflow again.
It then opens a pull request that starts the next development version and removes `CRAN-SUBMISSION`.

If CRAN doesn't serve the version yet, the workflow stops without changing anything, and you can run it again later.

If a run stops after it published the release, run it again: it keeps the existing release when its tag points to the submitted commit, and goes on to the development version.

## Scripts and tests

The workflows call the scripts in `.github/scripts/`.
Expand Down
55 changes: 55 additions & 0 deletions .github/scripts/check-results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
set -euo pipefail

# Compare the Status line of an R CMD check log with the results line of
# cran-comments.md, so the file sent to CRAN never reports fewer problems
# than the check found.
# Usage: check-results.sh <00check.log> [cran-comments.md]

log="${1:?Usage: check-results.sh <00check.log> [cran-comments.md]}"
comments="${2:-cran-comments.md}"

for file in "${log}" "${comments}"; do
if [ ! -f "${file}" ]; then
echo "::error::${file} does not exist." >&2
exit 1
fi
done

status="$(tr -d '\r' <"${log}" | sed -n 's/^Status:[[:space:]]*//p' | tail -n 1)"
if [ -z "${status}" ]; then
echo "::error::${log} has no Status line, so the check did not finish." >&2
exit 1
fi

count() {
local n
n="$(grep -oE "[0-9]+ $1" <<<"${status}" | grep -oE '^[0-9]+' || true)"
echo "${n:-0}"
}

found="$(count ERROR) $(count WARNING) $(count NOTE)"
claimed="$(tr -d '\r' <"${comments}" |
sed -nE 's/^([0-9]+) errors? \| ([0-9]+) warnings? \| ([0-9]+) notes?[[:space:]]*$/\1 \2 \3/p' |
head -n 1)"

if [ -z "${claimed}" ]; then
echo "::error::${comments} has no line like '0 errors | 0 warnings | 0 notes'." >&2
exit 1
fi

read -r errors warnings notes <<<"${found}"
read -r claimed_errors claimed_warnings claimed_notes <<<"${claimed}"
summary="${errors} errors | ${warnings} warnings | ${notes} notes"
claimed_summary="${claimed_errors} errors | ${claimed_warnings} warnings | ${claimed_notes} notes"
if [ "${claimed_errors}" -lt "${errors}" ] ||
[ "${claimed_warnings}" -lt "${warnings}" ] ||
[ "${claimed_notes}" -lt "${notes}" ]; then
{
echo "::error::${comments} reports fewer problems than the check found. The check found ${summary}, but ${comments} says ${claimed_summary}. Explain each problem in ${comments}, correct its results line, and run the CRAN submission again."
tr -d '\r' <"${log}" | grep -E '\.\.\. .*(NOTE|WARNING|ERROR)$' || true
} >&2
exit 1
fi

echo "${comments} reports at least what the check found: check ${summary}, ${comments} ${claimed_summary}"
13 changes: 10 additions & 3 deletions .github/scripts/release-guard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
set -euo pipefail

dir="${1:-.}"
version="$(sed -n 's/^Version:[[:space:]]*//p' "${dir}/DESCRIPTION" 2>/dev/null || true)"

field_value() {
sed -n "s/^$1:[[:space:]]*//p" "$2" 2>/dev/null |
tr -d '\r' |
sed 's/[[:space:]]*$//'
}

version="$(field_value Version "${dir}/DESCRIPTION" || true)"

if [ -z "${version}" ]; then
echo "::error::No Version field in ${dir}/DESCRIPTION." >&2
Expand All @@ -26,10 +33,10 @@ fi

recorded_versions() {
if [ -f "${dir}/CRAN-SUBMISSION" ]; then
sed -n 's/^Version:[[:space:]]*//p' "${dir}/CRAN-SUBMISSION"
field_value Version "${dir}/CRAN-SUBMISSION"
fi
git -C "${dir}" show origin/main:CRAN-SUBMISSION 2>/dev/null |
sed -n 's/^Version:[[:space:]]*//p' || true
field_value Version /dev/stdin || true
}

if grep -Fxq "${version}" <<<"$(recorded_versions)"; then
Expand Down
29 changes: 29 additions & 0 deletions .github/scripts/release-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

# Tell whether the tag v<version> exists, and stop when it points to another
# commit than the one submitted to CRAN.
# Usage: release-tag.sh <version> <sha> [dir]

version="${1:-}"
sha="${2:-}"
dir="${3:-.}"

if [ -z "${version}" ] || [ -z "${sha}" ]; then
echo "::error::Usage: release-tag.sh <version> <sha> [dir]" >&2
exit 1
fi

tagged="$(git -C "${dir}" rev-parse -q --verify "refs/tags/v${version}^{commit}" || true)"
if [ -z "${tagged}" ]; then
echo "tagged=false"
exit 0
fi

submitted="$(git -C "${dir}" rev-parse --verify "${sha}^{commit}")"
if [ "${tagged}" != "${submitted}" ]; then
echo "::error::v${version} points to ${tagged}, not to the submitted commit ${submitted}. Check the tag by hand before you run this again." >&2
exit 1
fi

echo "tagged=true"
76 changes: 76 additions & 0 deletions .github/scripts/tests/test-release-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,32 @@ out="$("${scripts}/release-guard.sh" "${tmp}/rerun")"
check "guard skips a version recorded on origin/main" false \
"$(field submit <<<"${out}")"

make_repo "${tmp}/crlf" 2.0.7
printf 'Package: NACHO\r\nVersion: 2.0.7 \r\n' >"${tmp}/crlf/DESCRIPTION"
out="$("${scripts}/release-guard.sh" "${tmp}/crlf")"
check "guard reads a version with CRLF line ends" 2.0.7 \
"$(field version <<<"${out}")"
check "guard submits a CRLF release version" true \
"$(field submit <<<"${out}")"

printf 'Version: 2.0.7\r\nDate: 2026-10-01 10:00:00 UTC\r\nSHA: abc\r\n' \
>"${tmp}/crlf/CRAN-SUBMISSION"
out="$("${scripts}/release-guard.sh" "${tmp}/crlf")"
check "guard skips a CRLF submission record" false \
"$(field submit <<<"${out}")"

make_repo "${tmp}/upstream-crlf" 2.0.7
git clone -q "${tmp}/upstream-crlf" "${tmp}/rerun-crlf"
printf 'Version: 2.0.7\r\nDate: 2026-10-01 10:00:00 UTC\r\nSHA: abc\r\n' \
>"${tmp}/upstream-crlf/CRAN-SUBMISSION"
git -C "${tmp}/upstream-crlf" add CRAN-SUBMISSION
git -C "${tmp}/upstream-crlf" -c user.name=test -c user.email=test@example.com \
-c commit.gpgsign=false commit -q -m record
git -C "${tmp}/rerun-crlf" fetch -q origin
out="$("${scripts}/release-guard.sh" "${tmp}/rerun-crlf")"
check "guard skips a CRLF version recorded on origin/main" false \
"$(field submit <<<"${out}")"

mkdir -p "${tmp}/empty"
check "guard fails without a version" 1 \
"$(status_of "${scripts}/release-guard.sh" "${tmp}/empty")"
Expand Down Expand Up @@ -188,6 +214,56 @@ check "bump rejects a malformed version" 1 \
check "bump fails without DESCRIPTION" 1 \
"$(status_of "${scripts}/bump-version.sh" patch "${tmp}/missing")"

printf '* checking CRAN incoming feasibility ... NOTE\nMaintainer: x\n* DONE\n\nStatus: 2 NOTEs\n' \
>"${tmp}/check-notes.log"
printf '* DONE\n\nStatus: OK\n' >"${tmp}/check-ok.log"
printf '* DONE\n\nStatus: 1 WARNING, 1 NOTE\n' >"${tmp}/check-warn.log"
printf '## R CMD check results\n\n0 errors | 0 warnings | 0 notes\n' \
>"${tmp}/comments-clean.md"
printf '## R CMD check results\n\n0 errors | 0 warnings | 2 notes\n\n- NOTE one.\n' \
>"${tmp}/comments-notes.md"
printf '## R CMD check results\r\n\r\n0 errors | 0 warnings | 0 notes\r\n' \
>"${tmp}/comments-crlf.md"
printf '## R CMD check results\n' >"${tmp}/comments-none.md"

check "results match a clean check" 0 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-ok.log" "${tmp}/comments-clean.md")"
check "results match a CRLF cran-comments.md" 0 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-ok.log" "${tmp}/comments-crlf.md")"
check "results stop on notes cran-comments.md leaves out" 1 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-notes.log" "${tmp}/comments-clean.md")"
check "results match notes cran-comments.md explains" 0 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-notes.log" "${tmp}/comments-notes.md")"
printf '## R CMD check results\n\n0 errors | 0 warnings | 1 note\n\n- NOTE one.\n' \
>"${tmp}/comments-one-note.md"
check "results accept a note cran-comments.md explains but the check did not find" 0 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-ok.log" "${tmp}/comments-one-note.md")"
check "results stop on a warning" 1 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-warn.log" "${tmp}/comments-notes.md")"
check "results stop without a results line" 1 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/check-ok.log" "${tmp}/comments-none.md")"
check "results stop without a check log" 1 \
"$(status_of "${scripts}/check-results.sh" "${tmp}/missing.log" "${tmp}/comments-clean.md")"
out="$("${scripts}/check-results.sh" "${tmp}/check-notes.log" "${tmp}/comments-clean.md" 2>&1 || true)"
check "results name the NOTE section" 1 \
"$(grep -c 'checking CRAN incoming feasibility' <<<"${out}")"

make_repo "${tmp}/tag" 2.0.7
first="$(git -C "${tmp}/tag" rev-parse HEAD)"
out="$("${scripts}/release-tag.sh" 2.0.7 "${first}" "${tmp}/tag")"
check "tag check reports a missing tag" false "$(field tagged <<<"${out}")"
git -C "${tmp}/tag" -c tag.gpgSign=false tag v2.0.7
out="$("${scripts}/release-tag.sh" 2.0.7 "${first}" "${tmp}/tag")"
check "tag check accepts a tag on the submitted commit" true \
"$(field tagged <<<"${out}")"
git -C "${tmp}/tag" -c user.name=test -c user.email=test@example.com \
-c commit.gpgsign=false commit -q --allow-empty -m later
second="$(git -C "${tmp}/tag" rev-parse HEAD)"
check "tag check stops on a tag on another commit" 1 \
"$(status_of "${scripts}/release-tag.sh" 2.0.7 "${second}" "${tmp}/tag")"
check "tag check fails without a version" 1 \
"$(status_of "${scripts}/release-tag.sh" "" "${first}" "${tmp}/tag")"

if [ "${failures}" -gt 0 ]; then
printf '%s check(s) failed\n' "${failures}"
exit 1
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
NACHO_REQUIRE_QUARTO: "true"

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: r-lib/actions/setup-pandoc@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2.14.0

- uses: quarto-dev/quarto-actions/setup@8a96df13519ee81fd526f2dfca5962811136661b # v2.2.0
with:
version: release

- uses: r-lib/actions/setup-r@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2.14.0
with:
r-version: ${{ matrix.config.r }}
Expand All @@ -55,11 +60,33 @@ jobs:
extra-packages: any::rcmdcheck
needs: check

- name: Install HTML Tidy
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y tidy

- uses: r-lib/actions/check-r-package@f9a764fea8d5c63df6ef9a5c7795bf7deb5d7e05 # v2.14.0
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

- name: Check the tarball stays under 5 MB
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
set -euo pipefail
tarball=$(find check -maxdepth 1 -name 'NACHO_*.tar.gz' -print -quit)
if [ -z "$tarball" ]; then
echo "::error::No NACHO tarball in check/; the check-r-package step must have changed where it builds."
exit 1
fi
size=$(stat -c %s "$tarball")
echo "Tarball size: ${size} bytes"
if [ "$size" -ge 5000000 ]; then
echo "::error::${tarball} is ${size} bytes, over the 5 MB CRAN guidance."
exit 1
fi

test-coverage:
needs: r-cmd-check
runs-on: ubuntu-latest
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/cran-post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,23 @@ jobs:
VERSION: ${{ steps.accepted.outputs.version }}
SHA: ${{ steps.accepted.outputs.sha }}
run: |
TAG_OUTPUT="$(.github/scripts/release-tag.sh "${VERSION}" "${SHA}")"
if gh release view "v${VERSION}" > /dev/null 2>&1; then
echo "::error::The release v${VERSION} already exists."
exit 1
if [ "$(gh release view "v${VERSION}" --json isDraft --jq .isDraft)" = "true" ]; then
echo "::error::The release v${VERSION} is a draft. Publish or delete it, then run this again."
exit 1
fi
if grep -Fxq "tagged=false" <<<"${TAG_OUTPUT}"; then
echo "::error::The release v${VERSION} exists without its tag. Delete the release, then run this again."
exit 1
fi
echo "The release v${VERSION} already exists on ${SHA}; going on to the development version."
else
gh release create "v${VERSION}" \
--target "${SHA}" \
--title "NACHO ${VERSION}" \
--notes-file "${RUNNER_TEMP}/release-notes.md"
fi
gh release create "v${VERSION}" \
--target "${SHA}" \
--title "NACHO ${VERSION}" \
--notes-file "${RUNNER_TEMP}/release-notes.md"

- name: Start the next development version
id: dev
Expand All @@ -76,6 +85,10 @@ jobs:
BRANCH="ci/dev-version-${VERSION//./-}"
.github/scripts/bump-version.sh dev
git rm -q CRAN-SUBMISSION
if git ls-remote --exit-code --heads origin "${BRANCH}" > /dev/null 2>&1; then
echo "::error::${BRANCH} already exists. Merge or close its pull request, delete the branch, then run this again."
exit 1
fi
git switch -c "${BRANCH}"
git add DESCRIPTION NEWS.md
git commit -m "chore: start development after NACHO ${VERSION}"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/cran-submit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,20 @@ jobs:
mkdir -p cran
Rscript -e 'path <- pkgbuild::build(".", dest_path = "cran", manual = TRUE); cat("tarball=", path, "\n", sep = "", file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE)'

- name: Install HTML Tidy
run: |
sudo apt-get update
sudo apt-get install -y tidy

- name: Run R CMD check --as-cran
env:
TARBALL: ${{ steps.build.outputs.tarball }}
run: |
Rscript -e 'rcmdcheck::rcmdcheck(Sys.getenv("TARBALL"), args = "--as-cran", error_on = "warning", check_dir = "check")'

- name: Compare the check with cran-comments.md
run: .github/scripts/check-results.sh check/NACHO.Rcheck/00check.log cran-comments.md

- name: Upload the tarball
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
Loading
Loading