Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GHA workflow for Linux builds #20

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Test build on various Linux distros
name: Linux build test

on:
workflow_dispatch:
inputs:
ubuntu-2204:
description: "Ubuntu 22.04"
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
debian-12:
description: "Debian 12"
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'
fedora-38:
description: "Fedora 38"
required: true
type: choice
options:
- 'yes'
- 'no'
default: 'yes'

jobs:
ubuntu-2204:
if: ${{ github.event.inputs.ubuntu-2204 == '' || github.event.inputs.ubuntu-2204 == 'yes' }}
runs-on: ubuntu-latest
name: Ubuntu 22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build in Docker
run: |
docker build -f tools/build/linux/Dockerfile-ubuntu-22.04 -t bqs:ubuntu2204 .
docker run bqs:ubuntu2204 R -q -e 'library(bigrquerystorage)'
debian-12:
if: ${{ github.event.inputs.debian-12 == '' || github.event.inputs.debian-12 == 'yes' }}
runs-on: ubuntu-latest
name: Debian 12
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build in Docker
run: |
docker build -f tools/build/linux/Dockerfile-debian-12 -t bqs:debian12 .
docker run bqs:debian12 R -q -e 'library(bigrquerystorage)'
fedora-38:
if: ${{ github.event.inputs.fedora-38 == '' || github.event.inputs.fedora-38 == 'yes' }}
runs-on: ubuntu-latest
name: Fedora 38
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build in Docker
run: |
docker build -f tools/build/linux/Dockerfile-fedora-38 -t bqs:fedora-38 .
docker run bqs:fedora-38 R -q -e 'library(bigrquerystorage)'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ src/google/
*.so
*.dll
.httr-oauth
/src/Makevars
1 change: 1 addition & 0 deletions inst/include/bigrquerystorage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <cstdint>
1 change: 1 addition & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include "../inst/include/bigrquerystorage.h"
#include <Rcpp.h>

using namespace Rcpp;
Expand Down
41 changes: 41 additions & 0 deletions tools/build/linux/Dockerfile-debian-12
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- Dockerfile -*-

FROM debian:12

# -------------------------------------------------------------------------
# This is going to use P3M on x86_64
COPY tools/build/linux/rig.gpg /etc/apt/trusted.gpg.d/rig.gpg
RUN echo "deb http://rig.r-pkg.org/deb rig main" > \
/etc/apt/sources.list.d/rig.list && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y r-rig && \
rig add release

# -------------------------------------------------------------------------
# FIXME: We don't need this once grpc is in the system requirements db
RUN apt-get install -y libprotobuf-dev protobuf-compiler-grpc \
libgrpc++-dev libc-ares-dev \
libre2-dev pkg-config

# -------------------------------------------------------------------------
# Only copy DESCRIPTION, so Docker can cache the dependency install
RUN mkdir /root/bigrquerystorage
COPY DESCRIPTION /root/bigrquerystorage/
WORKDIR /root/bigrquerystorage
# No upgrade, to always install binary packages, in case P3M is behind
RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)'

# -------------------------------------------------------------------------
# Call R CMD build first, so we get rid of Makevars, .o, .so, etc.
# Change file ownership, otherwise git complains
# Clean up thoroughly, in case the cleanup script is not perfect.
RUN apt-get install -y git
COPY . /root/bigrquerystorage
RUN chown root:root -R .
RUN git clean -fdx .

# -------------------------------------------------------------------------
WORKDIR /root
RUN R CMD build bigrquerystorage
RUN R CMD INSTALL bigrquerystorage_*.tar.gz
36 changes: 36 additions & 0 deletions tools/build/linux/Dockerfile-fedora-38
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- Dockerfile -*-

FROM fedora:38

# -------------------------------------------------------------------------
RUN yum install -y \
https://github.com/r-lib/rig/releases/download/latest/r-rig-latest-1.$(arch).rpm && \
rig add devel

# -------------------------------------------------------------------------
# FIXME: We don't need this once grpc is in the system requirements db
RUN dnf install -y protobuf-devel protobuf-compiler \
grpc-devel c-ares-devel \
re2-devel pkgconf

# -------------------------------------------------------------------------
# Only copy DESCRIPTION, so Docker can cache the dependency install
RUN mkdir /root/bigrquerystorage
COPY DESCRIPTION /root/bigrquerystorage/
WORKDIR /root/bigrquerystorage
# No upgrade, to always install binary packages, in case P3M is behind
RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)'

# -------------------------------------------------------------------------
# Call R CMD build first, so we get rid of Makevars, .o, .so, etc.
# Change file ownership, otherwise git complains
# Clean up thoroughly, in case the cleanup script is not perfect.
RUN dnf install -y git
COPY . /root/bigrquerystorage
RUN chown root:root -R .
RUN git clean -fdx .

# -------------------------------------------------------------------------
WORKDIR /root
RUN R CMD build bigrquerystorage
RUN R CMD INSTALL bigrquerystorage_*.tar.gz
41 changes: 41 additions & 0 deletions tools/build/linux/Dockerfile-ubuntu-22.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- Dockerfile -*-

FROM ubuntu:22.04

# -------------------------------------------------------------------------
# This is going to use P3M on x86_64
COPY tools/build/linux/rig.gpg /etc/apt/trusted.gpg.d/rig.gpg
RUN echo "deb http://rig.r-pkg.org/deb rig main" > \
/etc/apt/sources.list.d/rig.list && \
export DEBIAN_FRONTEND=noninteractive && \
apt-get update -y && \
apt-get install -y r-rig && \
rig add release

# -------------------------------------------------------------------------
# FIXME: We don't need this once grpc is in the system requirements db
RUN apt-get install -y libprotobuf-dev protobuf-compiler-grpc \
libgrpc++-dev libc-ares-dev libre2-dev \
pkg-config

# -------------------------------------------------------------------------
# Only copy DESCRIPTION first, so Docker can cache the dependency install
RUN mkdir /root/bigrquerystorage
COPY DESCRIPTION /root/bigrquerystorage/
WORKDIR /root/bigrquerystorage
# No upgrade, to always install binary packages, in case P3M is behind
RUN R -q -e 'pak::local_install_deps(upgrade = FALSE)'

# -------------------------------------------------------------------------
# Call R CMD build first, so we get rid of Makevars, .o, .so, etc.
# Change file ownership, otherwise git complains
# Clean up thoroughly, in case the cleanup script is not perfect.
RUN apt-get install -y git
COPY . /root/bigrquerystorage
RUN chown root:root -R .
RUN git clean -fdx .

# -------------------------------------------------------------------------
WORKDIR /root
RUN R CMD build bigrquerystorage
RUN R CMD INSTALL bigrquerystorage_*.tar.gz
Binary file added tools/build/linux/rig.gpg
Binary file not shown.
4 changes: 1 addition & 3 deletions tools/config/configure.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ if (mac) {
pkg_sources <- sort(dir("./src", ".cpp$|.c$"), decreasing = TRUE)

# linker libraries
linker_libs <- system(sprintf("%s --libs protobuf grpc++ openssl", pkg_config), intern = TRUE)
linker_libs <- system(sprintf("%s --libs protobuf grpc++", pkg_config), intern = TRUE)

# abseil no longer contains a dynamic_annotations library. brew install
# separatly, from Abseil LTS 20200923, Patch 1
Expand All @@ -179,8 +179,6 @@ if (mac) {
# some windows lib needs to be added manually for building with static openssl
if (isTRUE(win)) {
linker_libs <- paste(linker_libs, "-lcrypt32 -lws2_32 -limagehlp")
} else {
linker_libs <- paste(linker_libs, "-lupb_collections_lib -lupb_json_lib -lupb_textformat_lib -lupb -lutf8_range_lib -lre2 -lcares -laddress_sorting -lsystemd")
}

# compiler flags
Expand Down