-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action and dockerfile to build CI images
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build quantlib-devenv Docker images | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
boostVersion: | ||
description: 'Boost version' | ||
required: true | ||
env: | ||
ROLLING: lunar | ||
jobs: | ||
docker-images: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
tag: [lunar, mantic] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build CI images | ||
working-directory: dockerfiles | ||
run: | | ||
docker build -f ci.Dockerfile \ | ||
--build-arg tag=${{ matrix.tag }} \ | ||
--build-arg boost_version=${{ github.event.inputs.boostVersion }} \ | ||
--build-arg boost_dir=boost_$(echo "${{ github.event.inputs.boostVersion }}" | sed "s/\./_/g") \ | ||
-t ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} . | ||
docker tag ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}-${{ github.event.inputs.boostVersion }} | ||
if test "${{ matrix.tag }}" = "$ROLLING" ; then | ||
docker tag ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} ghcr.io/lballabio/quantlib-devenv:rolling | ||
fi | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GHCR_PAT }} | ||
- name: Push Docker images | ||
run: | | ||
docker push ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }}-${{ github.event.inputs.boostVersion }} | ||
docker push ghcr.io/lballabio/quantlib-devenv:${{ matrix.tag }} | ||
if test "${{ matrix.tag }}" = "$ROLLING" ; then | ||
docker push ghcr.io/lballabio/quantlib-devenv:rolling | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ARG tag=latest | ||
FROM ubuntu:${tag} | ||
MAINTAINER Luigi Ballabio <[email protected]> | ||
LABEL Description="Provide Docker images for QuantLib's CI builds on Linux" | ||
|
||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential wget libbz2-dev autoconf automake libtool ccache cmake clang git \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG boost_version | ||
ARG boost_dir | ||
ENV boost_version ${boost_version} | ||
|
||
RUN wget https://boostorg.jfrog.io/artifactory/main/release/${boost_version}/source/${boost_dir}.tar.gz \ | ||
&& tar xfz ${boost_dir}.tar.gz \ | ||
&& rm ${boost_dir}.tar.gz \ | ||
&& cd ${boost_dir} \ | ||
&& ./bootstrap.sh \ | ||
&& ./b2 --without-python --prefix=/usr -j 4 link=shared runtime-link=shared install \ | ||
&& cd .. && rm -rf ${boost_dir} && ldconfig | ||
|
||
CMD bash | ||
|