Skip to content

Commit

Permalink
Added github actions (#9)
Browse files Browse the repository at this point in the history
* Added workflow for building and testing

* Fixed bug in workflow yaml

* Fixed syntax error in workflow yaml

* Different setup for runing containers in github actions

* Trying to solve syntax error in container volumes definition

* Trying to solve syntax error in container volumes definition

* Trying to solve syntax error in container volumes definition using github variables

* Changed path of cvmfs

* Revert to commit e520eba and expose port 80

* Fix sintax error

* Fix sintax error

* Tests will output on failure

* Tests will output on failure

* source local repo install dir for integration tests

* Add doc workflow and workflows only run on nightlies now

* Add format check workflow

* Fix syntax error

* Fix format check syntax error

* Changed clang-format workflow to use cvmfs toolchain

* Jobs renamed
  • Loading branch information
Juanki0396 authored Jul 29, 2024
1 parent 15867a6 commit fb5d1df
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build-doc

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
build-docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
STACK: ['/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh']
OS: ['alma9',
'ubuntu22']
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-p 80:80 \
-d ghcr.io/key4hep/key4hep-images/${{ matrix.OS }}:latest \
/bin/bash
- name: CMake Configure
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
mkdir -p build install; \
source ${{ matrix.STACK }}; \
cd build; \
cmake -DCMAKE_INSTALL_PREFIX=../install ..'
- name: Generate doxygen documentation
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
cmake --build . --target doc'
23 changes: 23 additions & 0 deletions .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: clang-format-check

on: [push, pull_request]

jobs:
check-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-p 80:80 \
-d ghcr.io/key4hep/key4hep-images/ubuntu22:latest \
/bin/bash
- name: Run clang-format
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh; \
clang-format --dry-run --Werror src/* include/ral/*'
60 changes: 60 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build-and-test

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
STACK: ['/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh']
OS: ['alma9',
'ubuntu22']
steps:
- uses: actions/checkout@v4
- uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
docker run -it --name CI_container \
-v ${GITHUB_WORKSPACE}:/Package \
-v /cvmfs:/cvmfs:shared \
-p 80:80 \
-d ghcr.io/key4hep/key4hep-images/${{ matrix.OS }}:latest \
/bin/bash
- name: CMake Configure
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
mkdir -p build install; \
source ${{ matrix.STACK }}; \
cd build; \
cmake -DCMAKE_INSTALL_PREFIX=../install ..'
- name: Compile and Install
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
make ral install'
- name: Compile tests
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
make unittest'
- name: Run unittest
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
cd build; \
ctest -R unittest --output-on-failure'
- name: Run integration tests
run: |
docker exec CI_container /bin/bash -c 'cd Package; \
source ${{ matrix.STACK }}; \
k4_local_repo; \
cd build; \
ctest -R integration --output-on-failure'
2 changes: 1 addition & 1 deletion test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
add_test(NAME IntegrationReconstructedParticle
add_test(NAME integration_ReconstructedParticle
COMMAND python "${CMAKE_CURRENT_LIST_DIR}/ReconstructedParticle.py")
2 changes: 1 addition & 1 deletion test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
find_package(Catch2 3 REQUIRED)

# Defining the test executable
set(UNITTEST_NAME unnitest)
set(UNITTEST_NAME unittest)
add_executable("${UNITTEST_NAME}" ReconstructedParticle.cpp)
target_link_libraries("${UNITTEST_NAME}" PRIVATE Catch2::Catch2WithMain
"${PROJECT_NAME}")
Expand Down

0 comments on commit fb5d1df

Please sign in to comment.