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

updating CI R-CMD-check #740

Open
wants to merge 16 commits into
base: master
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
100 changes: 42 additions & 58 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,62 @@
# 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
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]
schedule:
- cron: '1 23 * * Sun'

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

defaults:
run:
shell: Rscript {0}

permissions: read-all

jobs:
R-CMD-check:
name: ${{ matrix.os }}, tf-${{ matrix.tf }}, R-${{ matrix.r}}
timeout-minutes: 30
runs-on: ${{ matrix.config.os }}

timeout-minutes: 60

name: ${{ matrix.config.os }} (${{ matrix.config.r }}) (${{ matrix.config.tf }})

strategy:
fail-fast: false
matrix:
include:
- {os: 'ubuntu-latest' , tf: 'default', r: 'release'}
- {os: 'windows-latest', tf: 'default', r: 'release'}
- {os: 'macOS-latest' , tf: 'default', r: 'release'}
config:
- {os: macos-latest, r: 'release', tf: 'default'}
- {os: windows-latest, r: 'release', tf: 'default'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release', tf: 'default'}
- {os: ubuntu-latest, r: 'release', tf: 'default'}
- {os: ubuntu-latest, r: 'oldrel-1', tf: 'default'}

runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.tf == 'nightly' || contains(matrix.tf, 'rc') || matrix.r == 'devel' }}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: 'true'
R_COMPILE_AND_INSTALL_PACKAGES: 'never'
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

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

- uses: r-lib/actions/setup-r@v2
id: setup-r
with:
r-version: ${{ matrix.r }}
r-version: ${{ matrix.config.r }}
Ncpus: '2L'
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

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

- name: Get Date
id: get-date
shell: bash
run: |
echo "::set-output name=year-week::$(date -u "+%Y-%U")"
echo "::set-output name=date::$(date -u "+%F")"

- name: Restore R package cache
uses: actions/cache@v2
id: r-package-cache
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ matrix.os }}-${{ steps.setup-r.outputs.installed-r-version }}-${{ steps.get-date.outputs.year-week }}-1
extra-packages: any::rcmdcheck
needs: check


- name: Install remotes
if: steps.r-package-cache.outputs.cache-hit != 'true'
run: install.packages("remotes")

- name: Install system dependencies
if: runner.os == 'Linux'
Expand All @@ -77,6 +69,10 @@ jobs:
sudo $cmd
done < <(Rscript -e "writeLines(remotes::system_requirements('$ID-$VERSION_ID'))")

- name: Install remotes
if: steps.r-package-cache.outputs.cache-hit != 'true'
run: install.packages("remotes")

- name: Install package + deps
run: remotes::install_local(dependencies = TRUE, force = TRUE)

Expand All @@ -88,30 +84,18 @@ jobs:
- name: Situation Report on greta install
run: greta::greta_sitrep()

- name: Install rcmdcheck
run: remotes::install_cran("rcmdcheck")

- name: Check
run: rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

- name: Show testthat output
if: always()
shell: bash
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true

- name: Don't use tar from old Rtools to store the cache
if: ${{ runner.os == 'Windows' && startsWith(steps.install-r.outputs.installed-r-version, '3') }}
shell: bash
run: echo "C:/Program Files/Git/usr/bin" >> $GITHUB_PATH

- name: Check on single core machine
if: runner.os != 'Windows'
env:
R_PARALLELLY_AVAILABLE_CORES: 1
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-multiarch"))

- name: Session info
run: |
options(width = 100)
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
# - name: Check on single core machine
# if: runner.os != 'Windows'
# env:
# R_PARALLELLY_AVAILABLE_CORES: 1
# run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-multiarch"))
12 changes: 9 additions & 3 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
issue_comment:
types: [created]

name: Commands
name: pr-commands.yaml

permissions: read-all

jobs:
document:
Expand All @@ -13,8 +15,10 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down Expand Up @@ -50,8 +54,10 @@ jobs:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,9 @@ jobs:

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

- name: Install system dependencies
if: runner.os == 'Linux'
shell: bash
run: |
. /etc/os-release
while read -r cmd
do
echo "$cmd"
sudo $cmd
done < <(Rscript -e "writeLines(remotes::system_requirements('$ID-$VERSION_ID'))")

- name: Install package + deps
run: remotes::install_local(dependencies = TRUE, force = TRUE)
shell: Rscript {0}
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,13 @@ If these python modules aren't yet installed, when `greta` is used, it provides

<!-- badges: start -->
[![CRAN status](https://www.r-pkg.org/badges/version/greta)](https://CRAN.R-project.org/package=greta)
[![R-CMD-check](https://github.com/greta-dev/greta/workflows/R-CMD-check/badge.svg)](https://github.com/greta-dev/greta/actions)
[![R-CMD-check](https://github.com/greta-dev/greta/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/greta-dev/greta/actions/workflows/R-CMD-check.yaml)
[![greta status badge](https://greta-dev.r-universe.dev/badges/greta)](https://greta-dev.r-universe.dev/greta)
[![Codecov test coverage](https://codecov.io/gh/greta-dev/greta/branch/master/graph/badge.svg)](https://app.codecov.io/gh/greta-dev/greta?branch=master)


[![Codecov test coverage](https://codecov.io/gh/greta-dev/greta/graph/badge.svg)](https://app.codecov.io/gh/greta-dev/greta)
[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0)
[![doi](https://zenodo.org/badge/73758247.svg)](https://zenodo.org/badge/latestdoi/73758247)
[![joss](https://joss.theoj.org/papers/10.21105/joss.01601/status.svg)](https://joss.theoj.org/papers/10.21105/joss.01601)

<!-- badges: end -->

![](logos/bottom_banner.png)
6 changes: 2 additions & 4 deletions tests/testthat/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ get_enough_draws <- function(
sampler = sampler,
n_effective = 5000,
time_limit = 300,
verbose = TRUE,
verbose = FALSE,
one_by_one = FALSE
) {
start_time <- Sys.time()
Expand Down Expand Up @@ -873,8 +873,7 @@ check_mvn_samples <- function(sampler, n_effective = 3000) {
draws <- get_enough_draws(
m,
sampler = sampler,
n_effective = n_effective,
verbose = FALSE
n_effective = n_effective
)

# get MCMC samples for statistics of the samples (value, variance and
Expand Down Expand Up @@ -927,7 +926,6 @@ check_samples <- function(
model = m,
sampler = sampler,
n_effective = n_effective,
verbose = TRUE,
one_by_one = one_by_one,
time_limit = time_limit
)
Expand Down
Loading