Skip to content

Commit

Permalink
fix main check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Sep 14, 2023
1 parent 6b2f8e2 commit 282487d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 72 deletions.
95 changes: 26 additions & 69 deletions .github/workflows/main_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
# additional example workflows available for the R community.


name: R-CMD-check

on:
push:
branches: [ "main" ]
pull_request:
types: closed
branches: [ "main" ]

permissions:
contents: read

name: github_workflow

jobs:
R-CMD-check:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
Expand All @@ -35,32 +37,39 @@ jobs:
- {os: ubuntu-latest, r: 'oldrel-1'}

steps:
# remove vignettes dir

- name: Remove vignettes dir
run: rm -rf 'vignettes/'
shell: bash

# checkout repo for workflow access
- uses: actions/checkout@v2
- name: Checkout repo for workflow access
uses: actions/checkout@v3

# setup R
- uses: r-lib/actions/setup-r@v2
- name: Set up R environment
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

# setup dependencies
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Set up dependencies (general)
uses: r-lib/actions/setup-r-dependencies@v2
env:
_R_CHECK_FORCE_SUGGESTS: false
_R_CHECK_RD_XREFS: false
with:
dependencies: '"hard"' # do not use suggested dependencies
extra-packages: any::rcmdcheck, any::testthat, any::data.table
extra-packages: any::rcmdcheck, any::testthat, any::rlang, any::R.utils, any::remotes

# run R CMD check
- uses: r-lib/actions/check-r-package@v2
- name: Set up dependencies (GiottoData)
run: |
suppressWarnings({
remotes::install_github('drieslab/GiottoData@suite_modular', build = FALSE)
})
shell: Rscript {0}

- name: Run R CMD check
uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
error-on: '"error"' # workflow errors on error only, can change to include warnings
Expand All @@ -71,66 +80,11 @@ jobs:
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- 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
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

# add code cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}


# lint:
# runs-on: ubuntu-latest
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - uses: actions/checkout@v3
#
# - uses: r-lib/actions/setup-r@v2
# with:
# use-public-rspm: true
#
# - uses: r-lib/actions/setup-r-dependencies@v2
# with:
# extra-packages: any::lintr, local::.
# needs: lint
#
# - name: Lint
# run: lintr::lint_package()
# shell: Rscript {0}
# env:
# LINTR_ERROR_ON_LINT: true


# render-rmarkdown:
# name: Update README.Rmd
# runs-on: ubuntu-latest
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
Expand All @@ -153,3 +107,6 @@ jobs:
# run: |
# git commit README.md -m 'Re-build README.Rmd' || echo "No changes to commit"
# git push origin || echo "No changes to commit"



2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ knitr::opts_chunk$set(
<!-- badges: start -->
![Version](https://img.shields.io/github/r-package/v/drieslab/GiottoVisuals)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test coverage](https://codecov.io/gh/jiajic/GiottoVisuals/branch/main/graph/badge.svg)](https://app.codecov.io/gh/jiajic/GiottoVisuals?branch=main)
[![codecov](https://codecov.io/github/drieslab/GiottoVisuals/graph/badge.svg?token=F4ga1Ahbhw)](https://codecov.io/github/drieslab/GiottoVisuals)
[![R-CMD-check](https://github.com/drieslab/GiottoVisuals/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/drieslab/GiottoVisuals/actions/workflows/R-CMD-check.yml)
[![GitHub issues](https://img.shields.io/github/issues/drieslab/Giotto)](https://github.com/drieslab/Giotto/issues)
[![GitHub pulls](https://img.shields.io/github/issues-pr/drieslab/GiottoVisuals)](https://github.com/drieslab/GiottoVisuals/pulls)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
![Version](https://img.shields.io/github/r-package/v/drieslab/GiottoVisuals)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![Codecov test
coverage](https://codecov.io/gh/jiajic/GiottoVisuals/branch/main/graph/badge.svg)](https://app.codecov.io/gh/jiajic/GiottoVisuals?branch=main)
[![codecov](https://codecov.io/github/drieslab/GiottoVisuals/graph/badge.svg?token=F4ga1Ahbhw)](https://codecov.io/github/drieslab/GiottoVisuals)
[![R-CMD-check](https://github.com/drieslab/GiottoVisuals/actions/workflows/R-CMD-check.yml/badge.svg)](https://github.com/drieslab/GiottoVisuals/actions/workflows/R-CMD-check.yml)
[![GitHub
issues](https://img.shields.io/github/issues/drieslab/Giotto)](https://github.com/drieslab/Giotto/issues)
Expand Down

0 comments on commit 282487d

Please sign in to comment.