diff --git a/.github/workflows/generate-edm4hep-file.yaml b/.github/workflows/generate-edm4hep-file.yaml deleted file mode 100644 index 98a061376..000000000 --- a/.github/workflows/generate-edm4hep-file.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Generate an EDM4Hep file - -on: - pull_request: - workflow_dispatch: - -jobs: - generate-file: - runs-on: ubuntu-latest - steps: - - shell: bash - run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - - uses: actions/cache@v4 - with: - path: ~/.cache/ccache - key: nightly-alma9-${{ env.NOW }} - restore-keys: | - nightly-alma9 - - - name: Start container - shell: bash - run: | - docker run --name container --privileged -v ${GITHUB_WORKSPACE}:/EDM4hep -v ~/.cache/ccache:/root/.cache/ccache -d ghcr.io/key4hep/key4hep-images/alma9-cvmfs tail -f /dev/null - - - name: Run script - run: | - cat <<'EOF' > ${GITHUB_WORKSPACE}/script_container.sh - - source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh - cd /EDM4hep - k4_local_repo - mkdir build - cd build - cmake .. -DCMAKE_CXX_STANDARD=20 -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja - time ninja install - ccache -s - - python3 /scripts/createEDM4hepFile.py - - EOF - - chmod +x ${GITHUB_WORKSPACE}/script_container.sh - - docker exec container /bin/bash -c "/mount.sh && /EDM4hep/script_container.sh" \ No newline at end of file diff --git a/scripts/createEDM4hepFile.py b/scripts/createEDM4hepFile.py index bc00e1d72..851347980 100644 --- a/scripts/createEDM4hepFile.py +++ b/scripts/createEDM4hepFile.py @@ -7,7 +7,7 @@ import argparse import sys -frames = 10 # How many frames or events will be written +frames = 3 # How many frames or events will be written vectorsize = 5 # For vector members, each vector member will have this size counter = count() # next(counter) will return 0, 1, 2, ... # used to generate the dummy data @@ -25,9 +25,8 @@ except AttributeError: print("The RNTuple writer from podio is not available but was requested") sys.exit(1) - - -writer = podio.root_io.Writer(output_file) +else: + writer = podio.root_io.Writer(output_file) for i in range(frames): print(f"Writing frame {i}") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3e238e52e..d02b9561b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -12,6 +12,9 @@ function(set_test_env _testname) ) endfunction() +add_test(NAME "Create an EDM4hep data file" COMMAND python ${PROJECT_SOURCE_DIR}/scripts/createEDM4hepFile.py) +set_test_env("Create an EDM4hep data file") + add_executable(write_events write_events.cc) target_include_directories(write_events PUBLIC ${PROJECT_SOURCE_DIR}/edm4hep ) target_link_libraries(write_events edm4hep podio::podioRootIO)