Skip to content

Commit

Permalink
GHA: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Oct 27, 2021
1 parent cf1d045 commit 25903d5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ jobs:
fail-fast: false
matrix:
config:
# - {os: windows-latest, r: 'devel' }
- {os: windows-latest, r: 'release' }
# - {os: macOS-latest, r: 'devel' }
- {os: macOS-latest, r: 'release' }
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- {os: ubuntu-20.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- {os: ubuntu-20.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
- {os: windows-latest, r: release }
- {os: macOS-latest, r: devel }
- {os: macOS-latest, r: release }
- {os: ubuntu-20.04, r: devel }
- {os: ubuntu-20.04, r: release }
- {os: ubuntu-20.04, r: oldrel }
- {os: ubuntu-20.04, r: 3.6 }
- {os: ubuntu-20.04, r: 3.3 }

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RSPM: ${{ matrix.config.rspm }}
RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
## R CMD check
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_LENGTH_1_CONDITION_: true
_R_CHECK_LENGTH_1_LOGIC2_: true
_R_CHECK_MATRIX_DATA_: true
_R_CHECK_CRAN_INCOMING_: false
_R_CHECK_SUGGESTS_ONLY_: true

steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-tinytex@v1

- name: Install additional LaTeX packages
Expand All @@ -44,14 +47,12 @@ jobs:
## Additional LaTeX packages needed by BiocStyle:
tlmgr install ae bera bibleref caption changepage enumitem everysel fancyhdr footmisc grfext hobsub marginfix mathtools nowidow parnotes parskip placeins preprint ragged2e setspace soul titlesec xstring
tlmgr list --only-installed
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

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

- name: Query dependencies
- name: Query R package dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
Expand All @@ -66,32 +67,37 @@ jobs:
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 (Linux)
- name: Install R package system dependencies (Linux)
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
sudo apt-get install libcurl4-openssl-dev
sudo apt install -y libcurl4-openssl-dev
- name: Install dependencies
- name: Install R package dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos = NULL, type = "source") ## self vignette engine
shell: Rscript {0}

- name: Install 'rcmdcheck'
run: |
remotes::install_cran("rcmdcheck")
library(rcmdcheck) ## triggers an error, if installation failed
shell: Rscript {0}

- name: Session info
run: |
options(width = 100)
capabilities()
pkgs <- installed.packages()[, "Package"]
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_: false
run: |
skip_vignettes <- (getRversion() < "4.0.0")
rcmdcheck::rcmdcheck(build_args = if (skip_vignettes) "--no-build-vignettes", args = c("--no-manual", "--as-cran", if (skip_vignettes) "--ignore-vignettes"), error_on = "warning", check_dir = "check")
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/covr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: covr

jobs:
covr:
if: "! contains(github.event.head_commit.message, '[ci skip]')"
if: "! contains(github.event.head_commit.message, '[ci skip]')"

runs-on: ubuntu-20.04

Expand Down Expand Up @@ -46,20 +46,19 @@ jobs:
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 (Linux)
if: runner.os == 'Linux'
- name: Install system dependencies
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
sudo apt-get install libcurl4-openssl-dev
- name: Install dependencies
run: |
install.packages(c("covr", "sessioninfo"))
remotes::install_deps(dependencies = TRUE)
install.packages(".", repos=NULL, type="source")
shell: Rscript {0}

- name: Session info
Expand Down

0 comments on commit 25903d5

Please sign in to comment.