Skip to content

ci: use sample HIPO file from xrootd #48

ci: use sample HIPO file from xrootd

ci: use sample HIPO file from xrootd #48

Workflow file for this run

name: HIPO CI
on:
pull_request:
push:
branches: [ master ]
tags: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build_cmake:
name: CMake build
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
- name: build
run: |
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=install
cmake --build build -j4
cmake --install build
- run: brew install tree
if: ${{ matrix.runner == 'macos-latest' }}
- run: tree install
build_make:
name: Makefile build
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
path: hipo_src
submodules: recursive # FIXME: need `lz4` submoudle for Makefile, whereas `cmake` does not
- name: build
working-directory: hipo_src
run: |
make -j4
make -j4 -C examples
- run: brew install tree
if: ${{ matrix.runner == 'macos-latest' }}
- run: tree hipo_src
- name: tar
run: tar cavf hipo_src{.tar.zst,}
- uses: actions/upload-artifact@v4
with:
name: build_make_${{ matrix.runner }}
retention-days: 5
path: hipo_src.tar.zst
download_test_data: # FIXME: it would be better to generate our own HIPO file here, rather than assuming this file will continue to exist
name: Download test data
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v4
id: cache
with:
key: test_data_xrootd
path: test_data.hipo
lookup-only: true
- name: install xrootd-client
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install xrootd-client
- name: download
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
xrdcp xroot://sci-xrootd.jlab.org//osgpool/hallb/clas12/validation/recon/dst/validation_files.tar.zst ./
- name: rename
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
tar xvf validation_files.tar.zst
mv -v $(find validation_files -type f -name "*.hipo" | head -n1) test_data.hipo
examples:
name: Run examples
needs: [ download_test_data, build_make ]
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/download-artifact@v4
with:
name: build_make_${{ matrix.runner }}
- name: untar artifacts
run: |
ls *.tar.zst | xargs -I{} tar xvf {}
rm *.tar.zst
mv -v hipo_src/* ./
rm -rf hipo_src
- name: get test data
uses: actions/cache/restore@v4
with:
key: test_data_xrootd
path: test_data.hipo
- run: examples/writeFile.exe
- run: examples/readFile.exe example_output.hipo
- run: examples/readFileTags.exe
- run: examples/showFile.exe example_output.hipo event::particle
- run: examples/readJson.exe test_data.hipo
- run: examples/tupleFile.exe
- run: examples/writeUserHeader.exe
- run: examples/bankRowList.exe test_data.hipo
- run: examples/histograms.exe test_data.hipo