Skip to content

Commit

Permalink
Update docs and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Nov 28, 2024
1 parent 46bc2dd commit d3c49e0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 70 deletions.
55 changes: 2 additions & 53 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# 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:
branches: [main, master]

name: test-coverage

jobs:# 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]
Expand All @@ -21,9 +11,10 @@ permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -69,46 +60,4 @@ jobs:
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
token <- Sys.getenv("CODECOV_TOKEN", "")
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"),
token = if (token != "") token
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

14 changes: 7 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ There are other alternatives for optimizing images with **R**:
`xfun::optipng()` with more options. Requires additional software to be
installed locally.

| tool | CRAN | Additional software? | Online? | API Key? | Limits? |
|-------------------|------|----------------------|---------|----------|-----------------------------|
| `xfun::tinify()` | Yes | No | Yes | Yes | 500 files/month (Free tier) |
| `xfun::optipng()` | Yes | Yes | No | No | No |
| **tinieR** | No | No | Yes | Yes | 500 files/month (Free tier) |
| **optout** | No | Yes | No | No | No |
| **resmush** | Yes | No | Yes | No | Max size 5Mb |
| tool | CRAN | Additional software? | Online? | API Key? | Limits? |
|----|----|----|----|----|----|
| `xfun::tinify()` | Yes | No | Yes | Yes | 500 files/month (Free tier) |
| `xfun::optipng()` | Yes | Yes | No | No | No |
| **tinieR** | No | No | Yes | Yes | 500 files/month (Free tier) |
| **optout** | No | Yes | No | No | No |
| **resmush** | Yes | No | Yes | No | Max size 5Mb |

: Table 1: **R** packages: Comparison of alternatives for optimizing images.

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ There are other alternatives for optimizing images with **R**:
`xfun::optipng()` with more options. Requires additional software to
be installed locally.

| tool | CRAN | Additional software? | Online? | API Key? | Limits? |
|-------------------|------|----------------------|---------|----------|-----------------------------|
| `xfun::tinify()` | Yes | No | Yes | Yes | 500 files/month (Free tier) |
| `xfun::optipng()` | Yes | Yes | No | No | No |
| **tinieR** | No | No | Yes | Yes | 500 files/month (Free tier) |
| **optout** | No | Yes | No | No | No |
| **resmush** | Yes | No | Yes | No | Max size 5Mb |
| tool | CRAN | Additional software? | Online? | API Key? | Limits? |
|----|----|----|----|----|----|
| `xfun::tinify()` | Yes | No | Yes | Yes | 500 files/month (Free tier) |
| `xfun::optipng()` | Yes | Yes | No | No | No |
| **tinieR** | No | No | Yes | Yes | 500 files/month (Free tier) |
| **optout** | No | Yes | No | No | No |
| **resmush** | Yes | No | Yes | No | Max size 5Mb |

Table 1: **R** packages: Comparison of alternatives for optimizing
images.
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"SystemRequirements": null
},
"keywords": ["r", "compress-images", "optimize-images", "resmushit", "api", "r-package"],
"fileSize": "677.978KB",
"fileSize": "676.758KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
4 changes: 2 additions & 2 deletions vignettes/resmush.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ url <- paste0(
)

resmush_url(url, outfile = "jpg_example_compress.jpg", overwrite = TRUE)
#> ══ resmush summary ═════════════════════════════════════════════════════════════
#> ══ resmush summary ═══════════════════════════════════════════════════════════════════════════════
#> ℹ Input: 1 url with size 178.7 Kb
#> ✔ Success for 1 url: Size now is 45 Kb (was 178.7 Kb). Saved 133.7 Kb (74.82%).
#> See result in directory '.'.
Expand Down Expand Up @@ -78,7 +78,7 @@ resmush_url(url,
outfile = "jpg_example_compress_low.jpg",
overwrite = TRUE, qlty = 3
)
#> ══ resmush summary ═════════════════════════════════════════════════════════════
#> ══ resmush summary ═══════════════════════════════════════════════════════════════════════════════
#> ℹ Input: 1 url with size 178.7 Kb
#> ✔ Success for 1 url: Size now is 2.2 Kb (was 178.7 Kb). Saved 176.4 Kb (98.74%).
#> See result in directory '.'.
Expand Down

0 comments on commit d3c49e0

Please sign in to comment.