Skip to content

Commit

Permalink
Merge pull request #20 from sjmgarnier/develop
Browse files Browse the repository at this point in the history
Preparation for 0.4. Add website. Move to Github actions. Fix documen…
  • Loading branch information
sjmgarnier authored Apr 10, 2021
2 parents 59e718f + ffc7061 commit dc82b3a
Show file tree
Hide file tree
Showing 35 changed files with 540 additions and 197 deletions.
5 changes: 4 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ img
data-raw
cran_graphs.R
Dockerfile
^\.travis\.yml$
^codecov\.yml$
README.md
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
86 changes: 86 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
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'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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: Restore R package cache
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: |
options(crayon.enabled = TRUE)
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
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
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: Restore R package cache
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: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: test-coverage

jobs:
test-coverage:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
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: Restore R package cache
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}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ vignettes/*.pdf
.RData
inst/doc
cran_graphs.R
docs
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

25 changes: 10 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: viridisLite
Type: Package
Title: Default Color Maps from 'matplotlib' (Lite Version)
Version: 0.3.0
Title: Colorblind-Friendly Color Maps (Lite Version)
Version: 0.4.0
Authors@R: c(
person("Simon", "Garnier", email = "[email protected]", role = c("aut", "cre")),
person("Noam", "Ross", email = "[email protected]", role = c("ctb", "cph")),
Expand All @@ -10,17 +10,12 @@ Authors@R: c(
person("Cédric", "Scherer", email = "[email protected]", role = c("ctb", "cph"))
)
Maintainer: Simon Garnier <[email protected]>
Description: Implementation of the 'viridis' - the default -, 'magma', 'plasma',
'inferno', and 'cividis' color maps for 'R'. 'viridis', 'magma', 'plasma',
and 'inferno' are ported from 'matplotlib' <http://matplotlib.org/>, a
popular plotting library for 'python'. 'cividis', was developed by Jamie R.
Nuñez and Sean M. Colby. These color maps are designed in such a way that
they will analytically be perfectly perceptually-uniform, both in regular
form and also when converted to black-and-white. They are also designed to
be perceived by readers with the most common form of color blindness (all
color maps in this package) and color vision deficiency ('cividis' only).
This is the 'lite' version of the more complete 'viridis' package that can
be found at <https://cran.r-project.org/package=viridis>.
Description: Color maps designed to improve graph readability for readers with
common forms of color blindness and/or color vision deficiency. The color
maps are also perceptually-uniform, both in regular form and also when
converted to black-and-white for printing. This is the 'lite' version of the
'viridis' package that also contains ggplot2 bindings and can be found at
<https://cran.r-project.org/package=viridis>.
License: MIT + file LICENSE
LazyData: TRUE
Encoding: UTF-8
Expand All @@ -31,6 +26,6 @@ Suggests:
ggplot2 (>= 1.0.1),
testthat,
covr
URL: https://github.com/sjmgarnier/viridisLite
URL: http://sjmgarnier.github.io/viridisLite, https://github.com/sjmgarnier/viridisLite
BugReports: https://github.com/sjmgarnier/viridisLite/issues
RoxygenNote: 6.1.1
RoxygenNote: 7.1.1
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export(plasma)
export(rocket)
export(turbo)
export(viridis)
export(viridis.map)
export(viridisMap)
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# viridisLite 0.4.0

## New features

* Add 3 more color maps: mako, rocket, and turbo.

## Minor improvements and fixes

* Minor bug fixes and improvements here and there.

---
Loading

0 comments on commit dc82b3a

Please sign in to comment.