From d6184c47eadbc02e0a8e104f09deb73cec84aaf2 Mon Sep 17 00:00:00 2001 From: wlandau Date: Thu, 29 Feb 2024 17:51:23 -0500 Subject: [PATCH 1/3] Write pretty json --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/build_universe.R | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index be3b84d..35efac7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: r.releases.utils Title: Utilities for An R Universe of Package Releases Description: Utilities for an R universe of package releases. -Version: 0.0.4 +Version: 0.0.5 License: MIT + file LICENSE URL: https://r-releases.github.io/r.releases.utils/, diff --git a/NEWS.md b/NEWS.md index 433cd35..f3f949c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# r.releases.utils 0.0.5 + +* Write pretty JSON to `packages.json` (@llrs, https://github.com/r-releases/help/issues/4). + # r.releases.utils 0.0.4 * Relax some assertions so `build_universe()` can run on reasonable cases. diff --git a/R/build_universe.R b/R/build_universe.R index ca6c044..49656ed 100644 --- a/R/build_universe.R +++ b/R/build_universe.R @@ -21,7 +21,7 @@ build_universe <- function(input = getwd(), output = "packages.json") { dir.create(dirname(output)) } message("Writing packages.json.") - jsonlite::write_json(x = aggregated, path = output) + jsonlite::write_json(x = aggregated, path = output, pretty = TRUE) invisible() } From d5129f08356539b5599f9d64055382f0eb386bdf Mon Sep 17 00:00:00 2001 From: wlandau Date: Thu, 29 Feb 2024 18:05:24 -0500 Subject: [PATCH 2/3] Add runners --- .github/workflows/check.yaml | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index bb1194f..95234b6 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -3,8 +3,20 @@ on: [push, pull_request] name: check jobs: - check: - runs-on: ubuntu-latest + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} @@ -17,6 +29,8 @@ jobs: - 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@v2 @@ -24,11 +38,7 @@ jobs: extra-packages: any::rcmdcheck needs: check - - name: Git config - run: | - git config --global user.email "actions@github.com" - git config --global user.name "GitHub Actions" - - uses: r-lib/actions/check-r-package@v2 with: upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' From b29bae5866b9de1bb4e0ab34809430a66ef26b4c Mon Sep 17 00:00:00 2001 From: wlandau Date: Thu, 29 Feb 2024 18:07:22 -0500 Subject: [PATCH 3/3] Try a fix --- tests/test-build_universe.R | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/test-build_universe.R b/tests/test-build_universe.R index add3c01..5789835 100644 --- a/tests/test-build_universe.R +++ b/tests/test-build_universe.R @@ -129,7 +129,14 @@ out <- try( stopifnot(inherits(out, "try-error")) stopifnot( grepl( - pattern = "JSON entry for package 'paws.analytics' must have fields", + pattern = "JSON entry for package", + x = r.releases.utils::try_message(out), + fixed = TRUE + ) +) +stopifnot( + grepl( + pattern = "must have fields", x = r.releases.utils::try_message(out), fixed = TRUE )