diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index 69cb760..0000000 --- a/.codecov.yml +++ /dev/null @@ -1 +0,0 @@ -comment: false diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index 1f953ce..0000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,83 +0,0 @@ -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: windows-latest, r: 'release', vdiffr: true} - - {os: macOS-latest, r: 'release', vdiffr: true} - - {os: ubuntu-20.04, r: 'release', vdiffr: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', vdiffr: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} - VDIFFR_RUN_TESTS: ${{ matrix.config.vdiffr }} - VDIFFR_LOG_PATH: "../vdiffr.Rout.fail" - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check diff --git a/.github/workflows/check-standard.yaml b/.github/workflows/check-standard.yaml new file mode 100644 index 0000000..562fe0f --- /dev/null +++ b/.github/workflows/check-standard.yaml @@ -0,0 +1,51 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + +name: R-CMD-check.yaml + +permissions: read-all + +jobs: + 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 }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - 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 + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index f5aa3d8..0000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,48 +0,0 @@ -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master - -name: test-coverage - -jobs: - test-coverage: - runs-on: macOS-latest - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} - diff --git a/gridtext.Rproj b/gridtext.Rproj index 88ff2b5..cdba43d 100644 --- a/gridtext.Rproj +++ b/gridtext.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: 52bb813a-0917-450d-939d-f785066be174 RestoreWorkspace: Default SaveWorkspace: Default diff --git a/tests/figs/deps.txt b/tests/figs/deps.txt deleted file mode 100644 index 8d7f66b..0000000 --- a/tests/figs/deps.txt +++ /dev/null @@ -1,3 +0,0 @@ -- vdiffr-svg-engine: 1.0 -- vdiffr: 0.3.3 -- freetypeharfbuzz: 0.2.5 diff --git a/tests/figs/grid-renderer/rendering-raster-data.svg b/tests/figs/grid-renderer/rendering-raster-data.svg deleted file mode 100644 index d1d60e2..0000000 --- a/tests/figs/grid-renderer/rendering-raster-data.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/tests/figs/grid-renderer/text-in-different-stylings.svg b/tests/figs/grid-renderer/text-in-different-stylings.svg deleted file mode 100644 index d0f7cc7..0000000 --- a/tests/figs/grid-renderer/text-in-different-stylings.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -blue -red bold -roman - diff --git a/tests/figs/richtext-grob/aligned-heights.svg b/tests/figs/richtext-grob/aligned-heights.svg deleted file mode 100644 index 9c97d25..0000000 --- a/tests/figs/richtext-grob/aligned-heights.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -Some -text -in -bold. -(centered) - -Linebreaks -Linebreaks -Linebreaks - -x -2 -+ -5 -x -+ -C -i -a -= -5 -Box heights aligned, content centered - - - - diff --git a/tests/figs/richtext-grob/aligned-widths.svg b/tests/figs/richtext-grob/aligned-widths.svg deleted file mode 100644 index 059047e..0000000 --- a/tests/figs/richtext-grob/aligned-widths.svg +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - -Some -text -in -bold. -(centered) - -Linebreaks -Linebreaks -Linebreaks - -x -2 -+ -5 -x -+ -C -i -a -= -5 -Box widths aligned, content centered - - - - diff --git a/tests/figs/richtext-grob/various-text-boxes-w-debug.svg b/tests/figs/richtext-grob/various-text-boxes-w-debug.svg deleted file mode 100644 index 7689146..0000000 --- a/tests/figs/richtext-grob/various-text-boxes-w-debug.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - -Some -text -in -bold. -(centered) - -Linebreaks -Linebreaks -Linebreaks - -x -2 -+ -5 -x -+ -C -i -a -= -5 - - - - - - - diff --git a/tests/figs/richtext-grob/various-text-boxes.svg b/tests/figs/richtext-grob/various-text-boxes.svg deleted file mode 100644 index 8d73550..0000000 --- a/tests/figs/richtext-grob/various-text-boxes.svg +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - -Various -text -boxes -in -different -stylings - -Some -text -in -bold. -(centered) - -Linebreaks -Linebreaks -Linebreaks - -x -2 -+ -5 -x -+ -C -i -a -= -5 - - - - - diff --git a/tests/figs/textbox-grob/box-spanning-entire-viewport-with-margins.svg b/tests/figs/textbox-grob/box-spanning-entire-viewport-with-margins.svg deleted file mode 100644 index 789e5c1..0000000 --- a/tests/figs/textbox-grob/box-spanning-entire-viewport-with-margins.svg +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. -The -quick -brown -fox -jumps -over -the -lazy -dog. -The -quick -brown -fox -jumps -over -the -lazy -dog. -The -quick -brown -fox -jumps -over -the -lazy -dog. - Box spanning entire viewport, with margins - - diff --git a/tests/figs/textbox-grob/multiple-boxes-internal-alignment.svg b/tests/figs/textbox-grob/multiple-boxes-internal-alignment.svg deleted file mode 100644 index fdc064d..0000000 --- a/tests/figs/textbox-grob/multiple-boxes-internal-alignment.svg +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - -The -quick -brown -fox -jumps -over -the -lazy -dog. - -The -quick -brown -fox -jumps -over -the -lazy -dog. - -The -quick -brown -fox -jumps -over -the -lazy -dog. - diff --git a/tests/figs/textbox-grob/multiple-boxes-inverted-internal-alignment.svg b/tests/figs/textbox-grob/multiple-boxes-inverted-internal-alignment.svg deleted file mode 100644 index 6369cca..0000000 --- a/tests/figs/textbox-grob/multiple-boxes-inverted-internal-alignment.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - diff --git a/tests/figs/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg b/tests/figs/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg deleted file mode 100644 index 9e46148..0000000 --- a/tests/figs/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - diff --git a/tests/figs/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg b/tests/figs/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg deleted file mode 100644 index 39ba4f2..0000000 --- a/tests/figs/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - diff --git a/tests/figs/textbox-grob/rotation-around-fixed-point.svg b/tests/figs/textbox-grob/rotation-around-fixed-point.svg deleted file mode 100644 index bd935c6..0000000 --- a/tests/figs/textbox-grob/rotation-around-fixed-point.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - -The -quick -brown -fox -jumps -over -the -lazy -dog. - - diff --git a/tests/figs/grid-renderer/mixing-text-and-boxes.svg b/tests/testthat/_snaps/grid-renderer/mixing-text-and-boxes.svg similarity index 69% rename from tests/figs/grid-renderer/mixing-text-and-boxes.svg rename to tests/testthat/_snaps/grid-renderer/mixing-text-and-boxes.svg index c478e47..78dd090 100644 --- a/tests/figs/grid-renderer/mixing-text-and-boxes.svg +++ b/tests/testthat/_snaps/grid-renderer/mixing-text-and-boxes.svg @@ -1,8 +1,8 @@ - + + + + + + + -text 1, square box blue -text 2, rounded box filled +text 1, square box blue +text 2, rounded box filled + diff --git a/tests/testthat/_snaps/grid-renderer/rendering-raster-data.svg b/tests/testthat/_snaps/grid-renderer/rendering-raster-data.svg new file mode 100644 index 0000000..64e1c40 --- /dev/null +++ b/tests/testthat/_snaps/grid-renderer/rendering-raster-data.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/tests/testthat/_snaps/grid-renderer/text-in-different-stylings.svg b/tests/testthat/_snaps/grid-renderer/text-in-different-stylings.svg new file mode 100644 index 0000000..57f54e9 --- /dev/null +++ b/tests/testthat/_snaps/grid-renderer/text-in-different-stylings.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + +blue +red bold +roman + + diff --git a/tests/testthat/_snaps/richtext-grob/aligned-heights.svg b/tests/testthat/_snaps/richtext-grob/aligned-heights.svg new file mode 100644 index 0000000..2bf0881 --- /dev/null +++ b/tests/testthat/_snaps/richtext-grob/aligned-heights.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + +Some +text +in +bold. +(centered) + +Linebreaks +Linebreaks +Linebreaks + +x +2 ++ +5 +x ++ +C +i +a += +5 +Box heights aligned, content centered + + + + + diff --git a/tests/testthat/_snaps/richtext-grob/aligned-widths.svg b/tests/testthat/_snaps/richtext-grob/aligned-widths.svg new file mode 100644 index 0000000..f7fe569 --- /dev/null +++ b/tests/testthat/_snaps/richtext-grob/aligned-widths.svg @@ -0,0 +1,48 @@ + + + + + + + + + + + + + +Some +text +in +bold. +(centered) + +Linebreaks +Linebreaks +Linebreaks + +x +2 ++ +5 +x ++ +C +i +a += +5 +Box widths aligned, content centered + + + + + diff --git a/tests/testthat/_snaps/richtext-grob/various-text-boxes-w-debug.svg b/tests/testthat/_snaps/richtext-grob/various-text-boxes-w-debug.svg new file mode 100644 index 0000000..8d35996 --- /dev/null +++ b/tests/testthat/_snaps/richtext-grob/various-text-boxes-w-debug.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + +Some +text +in +bold. +(centered) + +Linebreaks +Linebreaks +Linebreaks + +x +2 ++ +5 +x ++ +C +i +a += +5 + + + + + + + + diff --git a/tests/testthat/_snaps/richtext-grob/various-text-boxes.svg b/tests/testthat/_snaps/richtext-grob/various-text-boxes.svg new file mode 100644 index 0000000..7be0a77 --- /dev/null +++ b/tests/testthat/_snaps/richtext-grob/various-text-boxes.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + + +Various +text +boxes +in +different +stylings + +Some +text +in +bold. +(centered) + +Linebreaks +Linebreaks +Linebreaks + +x +2 ++ +5 +x ++ +C +i +a += +5 + + + + + + diff --git a/tests/testthat/_snaps/textbox-grob/box-spanning-entire-viewport-with-margins.svg b/tests/testthat/_snaps/textbox-grob/box-spanning-entire-viewport-with-margins.svg new file mode 100644 index 0000000..ec3aa7e --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/box-spanning-entire-viewport-with-margins.svg @@ -0,0 +1,61 @@ + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. +The +quick +brown +fox +jumps +over +the +lazy +dog. +The +quick +brown +fox +jumps +over +the +lazy +dog. +The +quick +brown +fox +jumps +over +the +lazy +dog. + Box spanning entire viewport, with margins + + + diff --git a/tests/testthat/_snaps/textbox-grob/multiple-boxes-internal-alignment.svg b/tests/testthat/_snaps/textbox-grob/multiple-boxes-internal-alignment.svg new file mode 100644 index 0000000..087d394 --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/multiple-boxes-internal-alignment.svg @@ -0,0 +1,62 @@ + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + +The +quick +brown +fox +jumps +over +the +lazy +dog. + +The +quick +brown +fox +jumps +over +the +lazy +dog. + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + diff --git a/tests/testthat/_snaps/textbox-grob/multiple-boxes-inverted-internal-alignment.svg b/tests/testthat/_snaps/textbox-grob/multiple-boxes-inverted-internal-alignment.svg new file mode 100644 index 0000000..7b64781 --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/multiple-boxes-inverted-internal-alignment.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + diff --git a/tests/testthat/_snaps/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg b/tests/testthat/_snaps/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg new file mode 100644 index 0000000..48c36aa --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/multiple-boxes-left-rotated-internal-alignment.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + diff --git a/tests/testthat/_snaps/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg b/tests/testthat/_snaps/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg new file mode 100644 index 0000000..bdae3c6 --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/multiple-boxes-right-rotated-internal-alignment.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + diff --git a/tests/testthat/_snaps/textbox-grob/rotation-around-fixed-point.svg b/tests/testthat/_snaps/textbox-grob/rotation-around-fixed-point.svg new file mode 100644 index 0000000..ef596af --- /dev/null +++ b/tests/testthat/_snaps/textbox-grob/rotation-around-fixed-point.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + +The +quick +brown +fox +jumps +over +the +lazy +dog. + + + diff --git a/tests/testthat/helper-vdiffr.R b/tests/testthat/helper-vdiffr.R index 8c45b0f..1d714a8 100644 --- a/tests/testthat/helper-vdiffr.R +++ b/tests/testthat/helper-vdiffr.R @@ -1,4 +1,4 @@ -expect_doppelganger <- function(title, fig, path = NULL, ...) { +expect_doppelganger <- function(title, fig, ...) { testthat::skip_if_not_installed("vdiffr") - vdiffr::expect_doppelganger(title, fig, path = path, ...) + vdiffr::expect_doppelganger(title, fig, ...) }