Skip to content

Commit

Permalink
Merge branch 'fix-ci' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Oct 4, 2023
2 parents 008d38c + a6a323c commit 09363b4
Show file tree
Hide file tree
Showing 67 changed files with 6,185 additions and 5,987 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
@@ -0,0 +1 @@
*.html
94 changes: 22 additions & 72 deletions .github/workflows/build.yml
@@ -1,25 +1,12 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.

name: R-CMD-check

# 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:
- dev
- release/*
- master
branches: [dev, master, fix-ci]
pull_request:
branches:
- dev
- release/*
- master
workflow_dispatch:
branches: [dev, master]

name: R-CMD-check

jobs:
R-CMD-check:
Expand All @@ -31,69 +18,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-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
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- name: Check out repository
uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- name: Set up R ${{ matrix.config.r }} on ${{ matrix.config.os }}
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

- name: Install Pandoc
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")
install.packages("BiocManager")
shell: Rscript {0}

- name: Restore cache, if available
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@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 package dependencies
run: |
BiocManager::install(c('SingleCellExperiment', 'TSCAN', 'AnnotationDbi', 'org.Hs.eg.db', 'impute'))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("rJava")
remotes::install_cran("RWeka")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-multiarch"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
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
83 changes: 37 additions & 46 deletions .github/workflows/linter.yml
@@ -1,57 +1,48 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
# 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: [dev, master, fix-ci]
pull_request:
branches: [dev, master]

# ======================================================== #
# Determines when the action is triggered #
# ======================================================== #

on: [push, pull_request]
name: linter

# ======================================================== #
# Determine actions to take #
# ======================================================== #
name: lint

jobs:
lint:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checking out the repository
uses: actions/checkout@v2
- uses: actions/checkout@v3

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

- name: Installing dependencies
uses: r-lib/actions/setup-r-dependencies@v1
with:
extra-packages: lintr
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::lintr, local::.
needs: lint

- name: Picking on the coding style
run: |
library(lintr)
style_rules <- list(
T_and_F_symbol_linter, assignment_linter, closed_curly_linter,
commas_linter, commented_code_linter, todo_comment_linter,
cyclocomp_linter, object_length_linter, equals_na_linter,
function_left_parentheses_linter, infix_spaces_linter,
line_length_linter, no_tab_linter, object_usage_linter,
open_curly_linter, paren_brace_linter, absolute_path_linter,
nonportable_path_linter, pipe_continuation_linter,
semicolon_terminator_linter, seq_linter, single_quotes_linter,
spaces_inside_linter, spaces_left_parentheses_linter,
trailing_blank_lines_linter, trailing_whitespace_linter,
undesirable_function_linter, undesirable_operator_linter,
unneeded_concatenation_linter
)
lint_package(linters = style_rules)
shell: Rscript {0}
- name: Lint
run: |
library(lintr)
style_rules <- list(
T_and_F_symbol_linter(), assignment_linter(), brace_linter(),
commas_linter(), commented_code_linter(), todo_comment_linter(),
equals_na_linter(),
function_left_parentheses_linter(), infix_spaces_linter(),
line_length_linter(), whitespace_linter(), object_usage_linter(),
absolute_path_linter(),
nonportable_path_linter(), pipe_continuation_linter(),
semicolon_linter(), seq_linter(), quotes_linter(),
spaces_inside_linter(), spaces_left_parentheses_linter(),
trailing_blank_lines_linter(), trailing_whitespace_linter(),
undesirable_function_linter(), undesirable_operator_linter(),
unnecessary_concatenation_linter()
)
lint_package(linters = style_rules)
shell: Rscript {0}
env:
LINTR_ERROR_ON_LINT: true
39 changes: 32 additions & 7 deletions .github/workflows/test-coverage.yaml
@@ -1,6 +1,11 @@
# 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, pull_request]
on:
push:
branches: [dev, master, fix-ci]
pull_request:
branches: [dev, master]

name: test-coverage

jobs:
Expand All @@ -10,16 +15,36 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- 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: covr
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
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@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package

0 comments on commit 09363b4

Please sign in to comment.