Skip to content

R devtools::install_github #30

R devtools::install_github

R devtools::install_github #30

name: R devtools::install_github
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SAT'
# To automatically cancel previous jobs in same branch or PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
PACKAGE_NAME: libkrigingtemplate
jobs:
install_github:
name: ${{ matrix.config.os }} (${{ matrix.r-version }})
strategy:
fail-fast: false
matrix:
config:
- { os: windows-latest }
- { os: macOS-latest }
- { os: ubuntu-latest }
r-version: [ '4.3' ]
runs-on: ${{ matrix.config.os }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
rtools-version: '43'
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install additional packages to compile devtools
shell: bash
run: |
# almost as explained in https://github.com/r-lib/devtools/issues/2131
sudo apt install -y build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
sudo apt install -y libharfbuzz-dev libfribidi-dev
if: matrix.config.os == 'ubuntu-latest'
- 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/${{ env.PACKAGE_NAME }}/${{ env.BRANCH_NAME }}/tools/install_packages.R
Rscript --no-save ./install_packages.R devtools
- name: install_github from ${{ env.BRANCH_NAME }}
shell: bash
run: Rscript -e "library(devtools); install_github('libKriging/${{ env.PACKAGE_NAME }}', ref='${{ env.BRANCH_NAME }}'); if (!library('${{ env.PACKAGE_NAME }}', character.only=TRUE, logical.return=TRUE)) quit(status=1, save='no')"