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")' 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() } 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 )