Skip to content

Commit

Permalink
update github ci
Browse files Browse the repository at this point in the history
* update github ci
  • Loading branch information
jeffreyhanson authored Aug 4, 2022
1 parent 067007f commit 40e8e79
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 153 deletions.
54 changes: 16 additions & 38 deletions .github/workflows/R-CMD-check-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,28 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- 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")
shell: Rscript {0}
- uses: r-lib/actions/setup-pandoc@v2

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
- uses: r-lib/actions/setup-r@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-
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- name: Install system dependencies
run: |
brew install gmp
brew install mpfr
brew install automake
brew install gdal
brew upgrade --cask chromedriver
- name: Install dependencies
run: |
options("install.packages.compile.from.source" = "never")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
remotes::install_cran("curl", pkgType = "source")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 4
extra-packages: |
any::rcmdcheck
any::XML
needs: |
check
- name: Session information
run: |
Expand All @@ -81,19 +67,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

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

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
79 changes: 24 additions & 55 deletions .github/workflows/R-CMD-check-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: 'release', pkgs: 'all'}
- {os: ubuntu-20.04, r: 'devel', pkgs: 'all'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'devel'}
- {os: ubuntu-20.04, r: 'devel', pkgs: 'depends only'}

env:
Expand All @@ -39,42 +39,28 @@ jobs:
steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- 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")
shell: Rscript {0}

- name: Cache R packages
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: |
sudo apt-get -y install libcurl4-openssl-dev libmpfr-dev libgmp3-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
cache-version: 4
extra-packages: |
any::covr
any::rcmdcheck
any::XML
prepr=?ignore
needs: |
check
coverage
- name: Install spatial R packages
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
remotes::install_cran("urlchecker")
pak::pkg_install("dickoa/prepr")
shell: Rscript {0}

- name: Session information
Expand All @@ -84,22 +70,15 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Set environmental variables for package checks
- name: Environmental variables
if: matrix.config.pkgs == 'depends only'
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- 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
args: 'c("--no-manual", "--as-cran", "--no-build-vignettes")'
upload-snapshots: true

- name: Show testthat output
if: always()
Expand All @@ -110,13 +89,3 @@ jobs:
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: covr::codecov()
shell: Rscript {0}

- name: Check URLs
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
result <- urlchecker::url_check()
if (nrow(result) > 0) {
print(result)
stop("Invalid URLs detected")
}
shell: Rscript {0}
51 changes: 26 additions & 25 deletions .github/workflows/R-CMD-check-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,36 @@ jobs:
CI: true

steps:
# configure git to prevent it from automatically converting line-endings
# this is important to avoid WARNINGS during CRAN checks
# that are false-positives, see:
# https://msmith.de/2020/03/12/r-cmd-check-github-actions.html
- name: Configure git
run: git config --global core.autocrlf false

- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- 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")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 4
extra-packages: |
any::rcmdcheck
any::XML
prepr=?ignore
needs: |
check
- name: Install dependencies
- name: Install spatial R packages
run: |
options("install.packages.compile.from.source" = "never", pkgType = "binary")
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
install.packages("remotes")
remotes::install_github("dickoa/prepr")
shell: Rscript {0}

- name: Session information
Expand All @@ -65,19 +74,11 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check
run: |
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--no-build-vignettes"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true

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

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
56 changes: 21 additions & 35 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,35 @@ jobs:
steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

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

- name: Query dependencies
- name: Install system 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")
shell: Rscript {0}
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt-get install \
libgdal-dev libgeos-dev libproj-dev \
libgmp3-dev libmpfr-dev libudunits2-dev
- name: Cache R packages
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-
cache-version: 4
extra-packages: |
any::rcmdcheck
any::XML
any::urlchecker
prepr=?ignore
needs: |
check
- name: Install system dependencies
- name: Install spatial R packages
run: |
sudo apt-get -y install \
libcurl4-openssl-dev coinor-libsymphony-dev coinor-libcbc-dev coinor-libclp-dev \
libudunits2-dev libgdal-dev libgeos-dev libproj-dev libglpk-dev
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
remotes::install_cran("covr")
remotes::install_bioc("lpsymphony")
remotes::install_cran("urlchecker")
pak::pkg_install("dickoa/prepr")
shell: Rscript {0}

- name: Session information
Expand All @@ -84,11 +75,6 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Set environmental variables for package checks
if: matrix.config.pkgs == 'depends only'
run: |
echo "_R_CHECK_DEPENDS_ONLY_=true" >> $GITHUB_ENV
- name: Check URLs
if: runner.os == 'Linux' && matrix.config.r == 'release'
run: |
Expand Down

0 comments on commit 40e8e79

Please sign in to comment.