Skip to content

Commit

Permalink
[GH][CI] Adds container build to GH actions
Browse files Browse the repository at this point in the history
Build the MetaCG container via GH actions workflow.
  • Loading branch information
jplehr committed Nov 3, 2024
1 parent 6b18ac9 commit 332235d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/mcg-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,19 @@ jobs:
run: cmake -B build -S .
- name: build
run: cmake --build build --parallel

build-container:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
context: .
file: "container/full-build"
tags: metacg-devel:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
43 changes: 43 additions & 0 deletions container/full-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM ubuntu:20.04

WORKDIR /opt/metacg

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && apt-get upgrade -y && apt-get install -y gcc g++ gdb cmake python3 apt-utils wget gnupg qt5-default git autoconf automake libtool zlib1g-dev zlib1g vim unzip python3-pip python3-pytest python3-pytest-cov openmpi-bin openmpi-common bison flex python2 bear

RUN pip3 install -U pip

RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key| apt-key add - && apt-get install -y libllvm-10-ocaml-dev libllvm10 llvm-10 llvm-10-dev llvm-10-doc llvm-10-examples llvm-10-runtime clang-10 clang-tools-10 clang-10-doc libclang-common-10-dev libclang-10-dev libclang1-10 clang-format-10 python3-clang-10 clangd-10 clang-tidy-10

RUN ln -s /usr/bin/clang-10 /usr/bin/clang && ln -s /usr/bin/clang++-10 /usr/bin/clang++

RUN mkdir -p deps/install && \
cd deps && \
wget http://apps.fz-juelich.de/scalasca/releases/cube/4.5/dist/cubelib-4.5.tar.gz && \
mkdir cubelib && \
cd cubelib && \
tar xzf ../cubelib-4.5.tar.gz && cd cubelib-4.5 && \
./configure --prefix=/opt/metacg/extern/install/cubelib && \
make -j $(nproc) && \
make install

RUN mkdir metacg

COPY ./build_submodules.sh /opt/metacg/metacg

RUN cd metacg && \
PATH=/opt/metacg/extern/install/cubelib/bin:$PATH ./build_submodules.sh $(nproc)

COPY . /opt/metacg/metacg

RUN cd metacg && cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/tmp/metacg \
-DCUBE_LIB=/opt/metacg/extern/install/cubelib/lib \
-DCUBE_INCLUDE=/opt/metacg/extern/install/cubelib/include/cubelib \
-DEXTRAP_INCLUDE=./extern/install/extrap/include \
-DEXTRAP_LIB=./extern/install/extrap/lib \
-DMETACG_BUILD_PGIS=ON \
-DMETACG_BUILD_CGCOLLECTOR=ON \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON && \
cmake --build build --parallel

0 comments on commit 332235d

Please sign in to comment.