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 Actions CI with custom development container and compilation caching #67

Open
wants to merge 6 commits into
base: master
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
12 changes: 12 additions & 0 deletions .github/alma9
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM almalinux:9
RUN set -x && \
uname -a && \
cat /etc/issue && \
dnf -y update && \
dnf -y install dnf-plug* && \
dnf config-manager --set-enabled crb && \
dnf -y install epel-release && \
dnf -y install cmake gcc-c++ doxygen zlib-devel expat-devel xerces-c-devel xerces-c ccache && \
yum -y clean all

RUN dnf -y copr enable averbyts/HEPrpms && yum -y install PTL-devel clhep-devel && yum -y clean all
73 changes: 73 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: publish
on:
push:
pull_request:
schedule:
- cron: "0 7 * * 2"

jobs:

build-geant4-docker-image-alma9:
runs-on: ubuntu-latest
name: Alma image
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Check if the Docker file was changed
id: changed-docker-files
uses: tj-actions/changed-files@v38
with:
files: .github/alma9

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the geant4 Docker image on the change of Dockerfile
if: steps.changed-docker-files.outputs.any_changed == 'true'
run: |
docker build . -f .github/alma9 --tag ghcr.io/andriish/geant4alma9:latest
docker run ghcr.io/andriish/geant4alma9:latest
docker push ghcr.io/andriish/geant4alma9:latest
- name: Build the geant4 Docker image on schedule
if: ${{ github.event_name == 'schedule' }}
run: |
docker build . -f .github/alma9 --tag ghcr.io/andriish/geant4alma9:latest
docker run ghcr.io/andriish/geant4alma9:latest
docker push ghcr.io/andriish/geant4alma9:latest


run-in-geant4-docker-image-alma9:
name: Alma
runs-on: ubuntu-latest
needs: build-geant4-docker-image-alma9
container:
image: ghcr.io/andriish/geant4alma9:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 3
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: alma9

- name: Run
run : |
cmake -S . -B BUILD -DGEANT4_INSTALL_DATA:BOOL=OFF -DGEANT4_USE_SYSTEM_CLHEP:BOOL=ON -DGEANT4_USE_SYSTEM_EXPAT:BOOL=ON \
-DGEANT4_USE_SYSTEM_ZLIB:BOOL=ON \
-DGEANT4_USE_SYSTEM_PTL:BOOL=ON \
-DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
-DGEANT4_USE_GDML:BOOL=ON \
-DGEANT4_BUILD_MULTITHREADED=ON -DGEANT4_BUILD_TLS_MODEL=global-dynamic \
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build BUILD