Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check mismatch #71

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 37 additions & 24 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
push:
branches: [main, actions]
branches: [main, master]
pull_request:
branches: [main, actions]
branches: [main, master]

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -18,44 +24,44 @@ jobs:
fail-fast: false
matrix:
config:
- { os: macOS-latest, r: 'release', allow_clip: TRUE }
- { os: windows-latest, r: 'release', allow_clip: TRUE }
- { os: windows-latest, r: 'devel', allow_clip: TRUE }
- { os: macOS-latest, r: "release", allow_clip: TRUE }
- { os: windows-latest, r: "release", allow_clip: TRUE }
- { os: windows-latest, r: "devel", allow_clip: TRUE }
- {
os: ubuntu-latest,
r: 'devel',
http-user-agent: 'release',
r: "devel",
http-user-agent: "release",
allow_clip: TRUE,
clip_type: xclip,
}
- {
os: ubuntu-latest,
r: 'release',
r: "release",
allow_clip: TRUE,
clip_type: xclip,
}
- {
os: ubuntu-latest,
r: 'release',
r: "release",
allow_clip: TRUE,
clip_type: xsel,
}
- { os: ubuntu-latest, r: 'release', clip_type: xsel }
- { os: ubuntu-latest, r: "release", clip_type: xsel }
- {
os: ubuntu-latest,
r: 'release',
r: "release",
allow_clip: TRUE,
clip_type: none,
}
- {
os: ubuntu-latest,
r: 'release',
r: "release",
allow_clip: TRUE,
clip_type: nodisplay,
}
- {
os: ubuntu-latest,
r: 'oldrel-1',
r: "oldrel-1",
allow_clip: TRUE,
clip_type: xclip,
}
Expand All @@ -65,7 +71,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install and run XVFB
if: ${{ matrix.config.clip_type == 'xclip' || matrix.config.clip_type == 'xsel' }}
Expand All @@ -82,7 +88,7 @@ jobs:
uptime | xclip -i -sel p -f | xclip -i -sel c
xclip -o -sel clipboard
env:
DISPLAY: ':99.0'
DISPLAY: ":99.0"

- name: Install xclip (nodisplay)
if: ${{ matrix.config.clip_type == 'nodisplay' }}
Expand All @@ -94,27 +100,34 @@ jobs:
run: |
sudo apt-get install -y xsel

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- 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@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
if: ${{ matrix.config.clip_type != 'nodisplay' }}
env:
ALLOW_CLIP: ${{ matrix.config.allow_clip }}
CLIP_TYPE: ${{ matrix.config.clip_type }}
DISPLAY: ':99.0'
DISPLAY: ":99.0"
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
if: ${{ matrix.config.clip_type == 'nodisplay' }}
env:
ALLOW_CLIP: ${{ matrix.config.allow_clip }}
CLIP_TYPE: ${{ matrix.config.clip_type }}
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
39 changes: 27 additions & 12 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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]
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

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

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
extra-packages: any::pkgdown, local::.
needs: website

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
85 changes: 85 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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:
issue_comment:
types: [created]

name: pr-commands.yaml

permissions: read-all

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'

- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'

- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# 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.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_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, any::xml2
needs: coverage

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

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- 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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ VignetteBuilder:
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.2
RoxygenNote: 7.3.0
SystemRequirements: xclip (https://github.com/astrand/xclip) or
xsel (http://www.vergenet.net/~conrad/software/xsel/) for accessing
the X11 clipboard, or wl-clipboard (https://github.com/bugaevc/wl-clipboard)
Expand Down
6 changes: 5 additions & 1 deletion R/clipr-package.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' clipr: Read and Write from the System Clipboard
#'
#' Simple utility functions to read from and write to the Windows, OS X, and X11
Expand All @@ -11,6 +15,6 @@
#' [clipr_available()] is useful when building packages that
#' depend on clipr functionality.
#'
#' @docType package
#' @name clipr
## usethis namespace: end
NULL
8 changes: 6 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ knitr::opts_chunk$set(
clipr
=====

[![CRAN status.](https://www.r-pkg.org/badges/version/clipr)](https://www.r-pkg.org/pkg/clipr)
![Downloads, grand total](https://cranlogs.r-pkg.org/badges/grand-total/clipr)
<!-- badges: start -->
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/clipr)](https://cran.r-project.org/package=clipr)
[![Downloads, grand total](http://cranlogs.r-pkg.org/badges/grand-total/clipr)](https://cranlogs.r-pkg.org/)
[![R-CMD-check](https://github.com/mdlincoln/clipr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mdlincoln/clipr/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/mdlincoln/clipr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/mdlincoln/clipr?branch=master)
<!-- badges: end -->


Simple utility functions to read and write from the system clipboards of Windows, OS X, and Unix-like systems (which require either xclip or xsel.)

Expand Down
Loading