Initial CI workflow for Drone
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Marek Nečada 2022-06-09 05:14:45 +03:00
parent e69b927ec3
commit b525c66043
11 changed files with 136 additions and 0 deletions

75
.drone.yml Normal file
View File

@ -0,0 +1,75 @@
---
kind: pipeline
type: docker
name: buildqpms-alpine-preinstlibs
workspace:
path: /home/qpmsbuild/qpms
# don't run in master until the python/lapacke linking problem is resolved
trigger:
branch:
exclude:
- master
steps:
- name: chown
image: qpms/buildenv/alpine/pkgdnumlib
pull: never
commands:
- chown -R qpmsbuild.qpmsbuild .
- name: submodules
image: qpms/buildenv/alpine/pkgdnumlib
pull: never
user: qpmsbuild
commands:
- git submodule init
- git submodule update
- name: build
image: qpms/buildenv/alpine/pkgdnumlib
pull: never
user: qpmsbuild
commands:
- cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local .
- make install
- export LIBRARY_PATH=$HOME/.local/lib
- python3 setup.py install --user
- cd examples/rectangular/modes
- pip3 install --user matplotlib #needed to run the example
- export LD_LIBRARY_PATH=$HOME/.local/lib
- ./01a_realfreq_svd.sh
---
kind: pipeline
type: docker
name: buildqpms-debian-preinstlibs
workspace:
path: /home/qpmsbuild/qpms
steps:
- name: chown
image: qpms/buildenv/debian/pkgdnumlib
pull: never
commands:
- chown -R qpmsbuild.qpmsbuild .
- name: submodules
image: qpms/buildenv/debian/pkgdnumlib
pull: never
user: qpmsbuild
commands:
- git submodule init
- git submodule update
- name: build
image: qpms/buildenv/debian/pkgdnumlib
pull: never
user: qpmsbuild
commands:
- cmake -DCMAKE_INSTALL_PREFIX=/home/qpmsbuild/.local .
- make install
- export LIBRARY_PATH=$HOME/.local/lib
- python3 setup.py install --user
- cd examples/rectangular/modes
- pip3 install --user matplotlib #needed to run the example
- export LD_LIBRARY_PATH=$HOME/.local/lib
- ./01a_realfreq_svd.sh

View File

@ -1,3 +1,5 @@
[![Build Status](https://drone.perkele.eu/api/badges/QPMS/qpms/status.svg)](https://drone.perkele.eu/QPMS/qpms)
QPMS README QPMS README
=========== ===========

7
ci/00_make_dockerfiles.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
DP=Dockerfile_parts
# "Build environment" Dockerfiles
cat >Dockerfile.benv.debian.bnl ${DP}/00_common.debian ${DP}/01_numlibs.built
cat >Dockerfile.benv.debian.pnl ${DP}/00_common.debian ${DP}/01_numlibs.debian.pkgd
cat >Dockerfile.benv.alpine.bnl ${DP}/00_common.alpine ${DP}/01_numlibs.built
cat >Dockerfile.benv.alpine.pnl ${DP}/00_common.alpine ${DP}/01_numlibs.alpine.pkgd

5
ci/01_make_buildenv_images.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
docker build -t qpms/buildenv/debian/builtnumlib -f Dockerfile.benv.debian.bnl .
docker build -t qpms/buildenv/debian/pkgdnumlib -f Dockerfile.benv.debian.pnl .
docker build -t qpms/buildenv/alpine/builtnumlib -f Dockerfile.benv.alpine.bnl .
docker build -t qpms/buildenv/alpine/pkgdnumlib -f Dockerfile.benv.alpine.pnl .

View File

@ -0,0 +1,5 @@
FROM alpine:latest AS commondeps
RUN apk update \
&& apk add cmake python3-dev py3-pip gcc g++ wget git make libc-dev \
&& adduser -D qpmsbuild

View File

@ -0,0 +1,6 @@
FROM debian:stable AS commondeps
RUN apt-get update \
&& apt-get -y install --no-install-recommends build-essential cmake python3 python3-pip git wget python3-dev \
&& apt-get clean \
&& useradd -m qpmsbuild

View File

@ -0,0 +1,3 @@
FROM commondeps AS numlibs
# openblas-dev adds gfortran :(
RUN apk add openblas-dev gsl-dev

View File

@ -0,0 +1,16 @@
FROM commondeps AS buildopenblas
USER qpmsbuild
RUN cd && git clone --depth 1 https://github.com/xianyi/OpenBLAS.git \
&& cd OpenBLAS && make \
&& make install PREFIX=$HOME/.local/ \
&& make clean \
&& cd .. && rm -rf OpenBLAS
FROM buildopenblas AS numlibs
USER qpmsbuild
RUN cd && wget https://ftp.gnu.org/gnu/gsl/gsl-latest.tar.gz \
&& tar xf gsl-latest.tar.gz \
&& cd $( tar tf gsl-latest.tar.gz | head -n 1 ) \
&& ./configure --prefix=$HOME/.local \
&& make && make install && make clean \
&& cd .. && rm -rf $OLDPWD gsl-latest.tar.gz

View File

@ -0,0 +1,4 @@
FROM commondeps AS numlibs
RUN apt-get -y install --no-install-recommends libopenblas-dev libgsl-dev liblapacke-dev \
&& apt-get clean

View File

@ -0,0 +1,12 @@
FROM numlibs AS buildqpms
USER qpmsbuild
ENV LD_LIBRARY_PATH /home/qpmsbuild/.local/lib
ENV LIBRARY_PATH /home/qpmsbuild/.local/lib
ENV C_INCLUDE_PATH /home/qpmsbuild/.local/include
RUN cd && git clone --depth 1 https://repo.or.cz/qpms.git \
&& cd qpms && git submodule init && git submodule update
RUN cd ~/qpms && cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local . \
&& make \
&& make install
RUN cd ~/qpms && python3 setup.py install --user

1
ci/drone.yml Symbolic link
View File

@ -0,0 +1 @@
../.drone.yml