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 clang 17 #2

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 36 additions & 3 deletions .github/workflows/build-sil-kit-ci-image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and publish ci-ubuntu-18.04 image
name: Build and publish ci-ubuntu images

on:
workflow_dispatch:
Expand All @@ -7,7 +7,7 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: MariusBgm/sil-kit-ci-ubuntu-18.04
jobs:
push_to_registry:
ubuntu-18.04:
name: Push Docker image to ghcr.io registry
runs-on: ubuntu-latest
steps:
Expand All @@ -28,10 +28,43 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@v6
with:
context: ./containers/ci-ubuntu-18.04/
build-contexts: |
utils=./utils/
file: ./containers/ci-ubuntu-18.04/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

ubuntu-20.04:
name: Push Docker image to ghcr.io registry
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./containers/ci-ubuntu-20.04/
build-contexts: |
utils=./utils/
file: ./containers/ci-ubuntu-20.04/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
59 changes: 59 additions & 0 deletions .github/workflows/ci-sil-kit-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test the Sil Kit Docker images

on:
pull_request:
branch: main

jobs:
ubuntu-1804:
name: Build and test SIL Kit using the Ubuntu 18.04 image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Build the Ubuntu 18.04 image
uses: docker/build-push-action@v6
with:
context: ./containers/ci-ubuntu/
build-contexts: |
utils=./utils/
build-args: |
UBUNTU_VERSION=18.04
file: ./containers/ci-ubuntu/Dockerfile
push: false
load: true
tags: sil-kit-test:latest

- name: Test the image
run: |
docker run -itd --name emmy_noether sil-kit-test:latest /bin/bash
docker cp ./utils/image_tests.sh emmy_noether:/home/image_tests.sh
docker exec -w /home/ emmy_noether sh image_tests.sh

ubuntu-2004:
name: Build and test SIL Kit using the Ubuntu 20.04 image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Build the Ubuntu 20.04 image
uses: docker/build-push-action@v6
with:
context: ./containers/ci-ubuntu/
build-contexts: |
utils=./utils/
build-args: |
UBUNTU_VERSION=20.04
file: ./containers/ci-ubuntu/Dockerfile
push: false
load: true
tags: sil-kit-test:latest

- name: Test the image
run: |
docker run -itd --name emmy_noether sil-kit-test:latest /bin/bash
docker cp ./utils/image_tests.sh emmy_noether:/home/image_tests.sh
docker exec -w /home/ emmy_noether sh image_tests.sh

41 changes: 0 additions & 41 deletions containers/ci-ubuntu-18.04/Dockerfile

This file was deleted.

48 changes: 48 additions & 0 deletions containers/ci-ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ARG UBUNTU_VERSION="18.04"

FROM ubuntu:${UBUNTU_VERSION}

ENV TZ "Europe/Berlin"
ENV DEBIAN_FRONTEND "noninteractive"
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8



# Install dependencies
RUN \
apt-get update \
&& \
apt-get install --no-install-recommends --no-install-suggests -y \
wget \
gnupg2 \
software-properties-common \
&& \
apt update \
&& \
apt install -y \
git \
build-essential \
sudo \
lsb-base \
lsb-release \
ninja-build \
doxygen \
python3-pip \
&& \
apt-get clean

COPY --from=utils fetch_cmake.sh /tmp/fetch_cmake.sh
COPY --from=utils docs_requirements.txt /tmp

ADD https://apt.llvm.org/llvm.sh /tmp


RUN chmod +x /tmp/fetch_cmake.sh
RUN /tmp/fetch_cmake.sh
ENV PATH /opt/vector/bin:$PATH
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install -r /tmp/docs_requirements.txt

RUN chmod +x /tmp/llvm.sh
RUN /tmp/llvm.sh 18
File renamed without changes.
18 changes: 18 additions & 0 deletions utils/image_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /usr/bin/env sh

set -e
CMAKE_PRESET="clang-relwithdebinfo"

echo "Building ${CMAKE_PRESET}"

CLANG_LOCATION=$(which clang-18)
CLANGPLUS_LOCATION=$(which clang++-18)
echo "Using: \n${CLANG_LOCATION} \n${CLANGPLUS_LOCATION}"

git -c http.sslverify=false clone --recursive --shallow-submodules --depth=1 https://github.com/vectorgrp/sil-kit.git

cd sil-kit

cmake -DCMAKE_C_COMPILER=${CLANG_LOCATION} -DCMAKE_CXX_COMPILER=${CLANGPLUS_LOCATION} --preset $CMAKE_PRESET
cmake --build --preset $CMAKE_PRESET
ctest --preset $CMAKE_PRESET