-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
108 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,113 +1,52 @@ | ||
# 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 | ||
# 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 | ||
- pre-release | ||
branches: [main, master] | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- pre-release | ||
branches: [main, master] | ||
|
||
name: R-CMD-check | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.os }} (R ${{ matrix.r }}) | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
r: ['4.3.3'] | ||
os: [ubuntu-latest, macOS-latest, windows-latest] | ||
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: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
R_REMOTES_UPGRADE: never | ||
VDIFFR_RUN_TESTS: true | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
_R_CHECK_LENGTH_1_CONDITION_: TRUE #deprecated from R 4.2.0 | ||
_R_CHECK_MATRIX_DATA_: TRUE # only works from R 4.2.0 onwards | ||
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.r }} | ||
|
||
- name: Install system dependencies on macOS | ||
if: runner.os == 'macOS' | ||
run: | | ||
# see https://github.com/orgs/Homebrew/discussions/4612 | ||
unset HOMEBREW_NO_INSTALL_FROM_API | ||
brew update | ||
brew install --cask xquartz | ||
brew install libarchive | ||
shell: bash | ||
|
||
- name: Install system dependencies on macOS specific to R devel | ||
if: runner.os == 'macOS' && matrix.r == 'devel' | ||
run: | | ||
# ragg requires harfbuzz fribidi | ||
# The dependencies of the two R packages below are required for compiling from source on Ubuntu, but macOS seems fine without them | ||
# credentials (dependency of usethis) requires libgit2 | ||
# curl (dependency of usethis) requires openssl | ||
brew install harfbuzz fribidi libgit2 openssl curl | ||
shell: bash | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
|
||
- name: Install system dependencies on linux | ||
if: runner.os == 'Linux' | ||
run: | | ||
# ragg requires libharfbuzz-dev libfribidi-dev | ||
# credentials (dependency of usethis) requires libgit2-dev | ||
# curl (dependency of usethis) requires libcurl4-openssl-dev | ||
# libicu (dependency of igraph or stringi...) requires libicu libicu-dev | ||
sudo apt install libharfbuzz-dev libfribidi-dev libgit2-dev libcurl4-openssl-dev libicu* | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
run: | | ||
install.packages("remotes") | ||
remotes::install_deps(dependencies = TRUE) | ||
remotes::install_cran("rcmdcheck") | ||
shell: Rscript {0} | ||
|
||
- name: Check | ||
if: runner.os != 'Windows' | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
rcmdcheck::rcmdcheck( | ||
args = c("--no-manual", "--as-cran", "--ignore-vignettes"), | ||
build_args = c("--no-build-vignettes"), | ||
error_on = "warning", | ||
check_dir = "check") | ||
shell: Rscript {0}" | ||
|
||
- name: Check | ||
if: runner.os == 'Windows' | ||
env: | ||
_R_CHECK_CRAN_INCOMING_REMOTE_: false | ||
run: | | ||
options(crayon.enabled = TRUE) | ||
rcmdcheck::rcmdcheck( | ||
args = c("--no-manual", "--as-cran", "--ignore-vignettes"), | ||
build_args = c("--no-build-vignettes"), | ||
error_on = "warning", | ||
check_dir = "check") | ||
shell: Rscript {0} | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
needs: check | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@main | ||
- uses: r-lib/actions/check-r-package@v2 | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
path: check | ||
upload-snapshots: true | ||
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
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 |