Skip to content

Build and update package library #197

Build and update package library

Build and update package library #197

Workflow file for this run

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
update:
description: 'Update the R package library'
name: Build and update package library
jobs:
Build:
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04', 'ubuntu-22.04']
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }}
steps:
- name: Prepare system
run: |
sudo apt-get update
sudo add-apt-repository -y "ppa:marutter/rrutter4.0"
sudo apt-get install -y git curl devscripts equivs gdebi-core
- name: Checkout
uses: actions/checkout@v4
- name: Update package library
if: ${{ github.event.inputs.update }}
run: |
(cd opencpu-lib; rm *.tar.gz; Rscript downloaddeps.R)
git add opencpu-lib
git status
- name: Install build dependencies
run: |
sudo mk-build-deps -i
- name: Build
run: |
echo "DEBUILD_TGZ_CHECK=no" >> ~/.devscripts
debuild -us -uc
- name: Test installing
run: |
sudo gdebi --n ../opencpu-lib_*.deb
sudo gdebi --n ../opencpu-server_*.deb
- name: Test server is up
run: curl -m5 --fail http://localhost/ocpu/info
- name: Test output formats
run: |
curl -m5 --fail http://localhost/ocpu/library/MASS/data/cats/ndjson
curl -m5 --fail http://localhost/ocpu/library/MASS/data/cats/arrowipc
- name: Print server logs
run: sudo cat /var/log/apache2/error.log
- name: Commit R package library updates
if: ${{ github.event.inputs.update && contains(matrix.os, 'ubuntu-22.04') }}
run: |
git config --global user.name 'Jeroen Ooms'
git config --global user.email 'jeroenooms@gmail.com'
git commit -m "Auto update package library"
git push