Skip to content

Merge pull request #19 from libKriging/fix-debian-clang-devel-Rcpp-co… #171

Merge pull request #19 from libKriging/fix-debian-clang-devel-Rcpp-co…

Merge pull request #19 from libKriging/fix-debian-clang-devel-Rcpp-co… #171

Workflow file for this run

name: rhub-local_check
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SAT'
env:
DEBUG_CI: true
jobs:
rhub-local_check:
strategy:
fail-fast: false
matrix:
#rhub::local_check_linux_images()
rhubos: [ 'debian-clang-devel','debian-gcc-devel','debian-gcc-devel-nold','debian-gcc-patched','debian-gcc-release','fedora-clang-devel','fedora-gcc-devel','rocker-gcc-san','ubuntu-gcc-devel','ubuntu-gcc-release' ]
# not suitable for compile: ,'ubuntu-rchk' ]
runs-on: ubuntu-latest
container:
image: rhub/${{ matrix.rhubos }}
options: --user root
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- name: Add dependencies
shell: bash
run: |
echo "`cat /etc/*-release | grep ID | cut -d= -f2 | head -1 | tr -d '\t'`"; \
if [ `cat /etc/*-release | grep ID | cut -d= -f2 | head -1 | tr -d '\t'` = "fedora" ]; \
then dnf install -y git cmake gfortran libcurl-devel libxml2-devel openssl-devel fontconfig-devel hdf5-devel; \
else apt-get update; apt-get install -y git cmake gfortran libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libxml2-dev libssl-dev libfontconfig1-dev libhdf5-dev; \
fi
- name: Add workaround dependencies
shell: bash
run: |
apt install -y libc++-dev libc++abi-dev
if: matrix.rhubos == 'debian-clang-devel'
- uses: actions/checkout@v3.0.2
# with:
# submodules: recursive
- name: Checkout submodules
shell: bash
run: |
git config --global --add safe.directory /__w/rlibkriging/rlibkriging
git submodule update --init --recursive
- name: Remove tmp requirements
shell: bash
run: |
if [ `cat /etc/*-release | grep ID | cut -d= -f2 | head -1 | tr -d '\t'` = "fedora" ]; \
then dnf remove -y git; \
else apt-get remove -y git; \
fi
- name: Install devtools
shell: bash
run: |
# Add --insecure to workaround missing certificates on Windows
# --header is not required by an useful example if the repo becomes private
curl --insecure --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -LO https://raw.githubusercontent.com/libKriging/rlibkriging/${{ env.BRANCH_NAME }}/tools/install_packages.R
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
Rscript --no-save ./install_packages.R devtools
- name: BioConductor install Rhdf5lib (Bioconductor deps not suported by devtools::install_github)
shell: bash
run: |
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
Rscript -e "install.packages('BiocManager',repos='https://cloud.r-project.org'); BiocManager::install('Rhdf5lib'); remove.packages('BiocManager')"
- name: devtools install_deps from ${{ env.BRANCH_NAME }}
shell: bash
run: |
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
Rscript -e "library(devtools); install_deps('.',dependencies = TRUE)"
# - name: devtools install_github from ${{ env.BRANCH_NAME }}
# shell: bash
# run: |
# export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
# Rscript -e "library(devtools); install_github('libKriging/rlibkriging', ref='${{ env.BRANCH_NAME }}'); if (!library('rlibkriging', character.only=TRUE, logical.return=TRUE)) quit(status=1, save='no')"
- name: setup for CRAN
shell: bash
run: |
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
Rscript --no-save ./install_packages.R roxygen2
./tools/setup.sh
Rscript -e "remove.packages('roxygen2')"
- name: R CMD build
shell: bash
env: # this alias helps to reuse following line as script
OS: ${{ matrix.rhubos }}
run: |
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
pushd ..
R CMD build rlibkriging
mkdir rlibkriging/CRAN-$OS
mv rlibkriging_*.* rlibkriging/CRAN-$OS/.
popd
- name: R CMD check
shell: bash
env:
OS: ${{ matrix.rhubos }}
run: |
export PATH=$PATH:/opt/R-devel/bin/:/opt/R-patched/bin/:/opt/R/bin
R CMD check --as-cran --no-manual CRAN-$OS/rlibkriging* || (
test -f rlibkriging.Rcheck/00install.out && cat rlibkriging.Rcheck/00install.out | sed -e 's/^/00install.out| /' && echo "[The error may be shown before 00install.out| listing";
exit 1
)