Skip to content

Commit

Permalink
Merge pull request #4 from wlandau/4
Browse files Browse the repository at this point in the history
Write pretty json
  • Loading branch information
shikokuchuo authored Mar 1, 2024
2 parents e711949 + b29bae5 commit 00e3c47
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 10 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -17,18 +29,16 @@ 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
with:
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")'
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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/,
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion R/build_universe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
9 changes: 8 additions & 1 deletion tests/test-build_universe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 00e3c47

Please sign in to comment.