fix: rework podio options to allow specifying list, includes, and excludes #5265
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build against eic-shell | |
on: | |
schedule: # run regularly on main branch | |
- cron: '13 0/8 * * *' | |
push: | |
branches: | |
- main | |
- 'v[0-9]+.[0-9]+' # maintenance branches | |
tags: | |
- '*' | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
inputs: | |
platform-release: | |
description: 'eic-shell version' | |
default: 'jug_xl:nightly' | |
required: false | |
type: string | |
detector-version: | |
description: 'epic geometry version' | |
default: 'main' | |
required: false | |
type: string | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
cancel-in-progress: true | |
env: | |
platform-release: ${{ inputs.platform-release || 'jug_xl:nightly' }} | |
detector-version: ${{ inputs.detector-version || 'main' }} | |
clang-tidy-iwyu-CC: clang | |
clang-tidy-iwyu-CMAKE_BUILD_TYPE: Debug | |
ASAN_OPTIONS: suppressions=${{ github.workspace }}/.github/asan.supp:malloc_context_size=20:detect_leaks=1:verify_asan_link_order=0:detect_stack_use_after_return=1:detect_odr_violation=1:new_delete_type_mismatch=0:intercept_tls_get_addr=0 | |
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/lsan.supp | |
UBSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/ubsan.supp:print_stacktrace=1 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- CC: gcc | |
CXX: g++ | |
CMAKE_BUILD_TYPE: Release | |
- CC: gcc | |
CXX: g++ | |
CMAKE_BUILD_TYPE: Debug | |
- CC: clang | |
CXX: clang++ | |
CMAKE_BUILD_TYPE: Release | |
- CC: clang | |
CXX: clang++ | |
CMAKE_BUILD_TYPE: Debug | |
CXXFLAGS: -fprofile-instr-generate -fcoverage-mapping | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Prepare ccache timestamp | |
id: ccache_cache_timestamp | |
run: | | |
echo "timestamp=$(date --iso-8601=minutes)" >> $GITHUB_OUTPUT | |
- name: Retrieve ccache cache files | |
uses: actions/cache@v4 | |
with: | |
path: .ccache | |
key: ccache-${{ matrix.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.head.ref || github.ref_name }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }} | |
restore-keys: | | |
ccache-${{ matrix.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.ref_name }}- | |
ccache-${{ matrix.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.head.ref }}- | |
ccache-${{ matrix.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.base.ref }}- | |
ccache-${{ matrix.CC }}-${{ matrix.CMAKE_BUILD_TYPE }}- | |
ccache-${{ matrix.CC }}- | |
ccache- | |
- name: Configure ccache | |
run: | | |
mkdir -p ~/.ccache/ | |
echo "cache_dir=${{ github.workspace }}/.ccache" > ~/.ccache/ccache.conf | |
echo "max_size=1500MB" >> ~/.ccache/ccache.conf | |
echo "compression=true" >> ~/.ccache/ccache.conf | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Build and install | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
# install this repo | |
CC="${{ matrix.CC }}" CXX="${{ matrix.CXX }}" CXXFLAGS="${{ matrix.CXXFLAGS }}" cmake -B build -S . -DCMAKE_INSTALL_PREFIX=install -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ matrix.CMAKE_BUILD_TYPE }} -DUSE_ASAN=ON -DUSE_TSAN=OFF -DUSE_UBSAN=ON | |
cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target install | |
ccache --show-stats --verbose | |
- name: Check dynamic library loader paths | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH | |
for lib in install/lib/*.so install/lib/EICrecon/plugins/*.so ; do | |
readelf -d $lib | |
ldd -r $lib | |
done | |
- name: Run testsuite | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
ctest --test-dir build -V | |
- name: Compress install directory | |
run: tar -caf install.tar.zst install/ | |
- name: Upload install directory | |
uses: actions/upload-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-${{ matrix.CMAKE_BUILD_TYPE }} | |
path: install.tar.zst | |
if-no-files-found: error | |
# Only compress and upload build directory if we are going to use it later | |
- name: Compress build directory | |
if: matrix.CC == env.clang-tidy-iwyu-CC && matrix.CMAKE_BUILD_TYPE == env.clang-tidy-iwyu-CMAKE_BUILD_TYPE | |
run: tar -caf build.tar.zst build/ | |
- name: Upload build directory | |
if: matrix.CC == env.clang-tidy-iwyu-CC && matrix.CMAKE_BUILD_TYPE == env.clang-tidy-iwyu-CMAKE_BUILD_TYPE | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.CC }}-eic-shell-${{ matrix.CMAKE_BUILD_TYPE }} | |
path: build.tar.zst | |
if-no-files-found: error | |
clang-tidy-iwyu: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- run: echo "FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: ${{ env.FETCH_DEPTH }} | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-${{ env.clang-tidy-iwyu-CC }}-eic-shell-${{ env.clang-tidy-iwyu-CMAKE_BUILD_TYPE }} | |
path: . | |
- name: Uncompress build artifact | |
run: tar -xaf build.tar.zst | |
- name: Run clang-tidy on changed files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
git diff ${{github.event.pull_request.base.sha}} ${{ github.event.pull_request.base.sha }} | clang-tidy-diff -p 1 -path build -quiet -export-fixes clang_tidy_fixes.yml -extra-arg='-std=c++20' -checks='-*,bugprone-*,-bugprone-narrowing-conversions' -clang-tidy-binary run-clang-tidy | |
- name: Run clang-tidy on all files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: ${{ github.event_name == 'push' }} | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
run-clang-tidy -p build -export-fixes clang_tidy_fixes.yml -extra-arg='-std=c++20' | |
- name: Upload clang-tidy fixes as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: clang-tidy-fixes.yml | |
path: clang_tidy_fixes.yml | |
if-no-files-found: ignore | |
- name: Suggest clang-tidy fixes as PR comments | |
uses: platisd/[email protected] | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
clang_tidy_fixes: clang_tidy_fixes.yml | |
request_changes: true | |
suggestions_per_comment: 10 | |
- name: Run include-what-you-use (iwyu) on changed files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
# reduce headers until diff is stable | |
while [[ ${sha:-} != $(git diff | sha256sum) ]] ; do | |
sha=$(git diff | sha256sum) | |
echo $sha | |
iwyu_tool.py -p build $(git diff --name-only ${{github.event.pull_request.head.sha}} ${{ github.event.pull_request.base.sha }}) -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log | |
fix_includes.py --blank_lines --nosafe_headers --reorder --separate_project_includes="<tld>" --keep_iwyu_namespace_format < iwyu_fixes.log | |
git diff | tee iwyu_fixes.patch | |
done | |
- name: Run include-what-you-use (iwyu) on all files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: ${{ github.event_name == 'push' }} | |
with: | |
platform-release: "${{ env.platform-release }}" | |
run: | | |
# don't aim for stability for all files | |
iwyu_tool.py -p build -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log | |
fix_includes.py --blank_lines --nosafe_headers --reorder --separate_project_includes="<tld>" --keep_iwyu_namespace_format < iwyu_fixes.log | |
git diff | tee iwyu_fixes.patch | |
- name: Upload iwyu patch as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: iwyu_fixes.patch | |
path: iwyu_fixes.patch | |
if-no-files-found: ignore # no file is good | |
- name: Fail when iwyu provided a patch for this pull request | |
if: ${{ github.event_name == 'pull_request' }} | |
run: git diff --exit-code | |
llvm-cov: | |
runs-on: ubuntu-latest | |
needs: build | |
permissions: | |
statuses: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download build artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-${{ env.clang-tidy-iwyu-CC }}-eic-shell-${{ env.clang-tidy-iwyu-CMAKE_BUILD_TYPE }} | |
path: . | |
- name: Uncompress build artifact | |
run: tar -xaf build.tar.zst | |
- run: sudo apt-get update | |
- run: sudo apt-get install -y llvm-15 jq | |
- name: llvm-cov | |
run: | | |
cd build | |
COV_OPTIONS=('--ignore-filename-regex=usr/local/include/eigen3.+') | |
llvm-profdata-15 merge -sparse src/tests/algorithms_test/algorithms_test.profraw \ | |
-o src/tests/algorithms_test/algorithms_test.profdata | |
LIB_PATHS=() | |
for LIB_NAME in algorithms_calorimetry algorithms_digi algorithms_pid algorithms_reco algorithms_tracking; do | |
LIB_PATH="$(find src/ -type f -name "*$LIB_NAME.so")" | |
LIB_PATHS+=("$LIB_PATH") | |
llvm-cov-15 report $LIB_PATH \ | |
-instr-profile=src/tests/algorithms_test/algorithms_test.profdata \ | |
"${COV_OPTIONS[@]}" | |
COV_PERCENT=$(llvm-cov-15 export $LIB_PATH \ | |
-instr-profile=src/tests/algorithms_test/algorithms_test.profdata \ | |
"${COV_OPTIONS[@]}" | jq '.data | map(.totals.regions.percent) | .[]' | xargs printf "%.1f\n") | |
if [ "${{ github.event.pull_request.head.repo.full_name }}" = "${{ github.repository }}" ]; then | |
curl --request POST \ | |
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }} \ | |
--header "Accept: application/vnd.github+json" \ | |
--header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
--header "X-GitHub-Api-Version: 2022-11-28" \ | |
--data '{ | |
"state": "success", | |
"context": "Code coverage ('$LIB_NAME') - '$COV_PERCENT'%" | |
}' \ | |
--fail-with-body | |
else | |
echo 'PR submitted from a fork. Skipping posting the "Code coverage ('$LIB_NAME') - '$COV_PERCENT'%" status.' | |
fi | |
done | |
llvm-cov-15 show "${LIB_PATHS[@]/#/--object=}" \ | |
-instr-profile=src/tests/algorithms_test/algorithms_test.profdata \ | |
-output-dir=codecov_report -format=html \ | |
"${COV_OPTIONS[@]}" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: codecov_report | |
path: build/codecov_report/ | |
npsim-gun: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
particle: [pi, e] | |
detector_config: [craterlake] | |
steps: | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Get detector info | |
id: detector_info | |
run: | | |
grep epic/nightly /cvmfs/singularity.opensciencegrid.org/eicweb/jug_xl\:nightly/etc/jug_info | sed 's/.*: .*-\(.*\)/hash=\1/g' >> $GITHUB_OUTPUT | |
- name: Retrieve simulation files | |
id: retrieve_simulation_files | |
uses: actions/cache@v4 | |
with: | |
path: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
key: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root-${{ steps.detector_info.outputs.hash }} | |
- name: Produce simulation files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.retrieve_simulation_files.outputs.cache-hit != 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
npsim --compactFile ${DETECTOR_PATH}/${DETECTOR}_${{ matrix.detector_config }}.xml -G --random.seed 1 --gun.particle "${{ matrix.particle }}-" --gun.momentumMin "1*GeV" --gun.momentumMax "20*GeV" --gun.distribution "uniform" -N 100 --outputFile sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -v WARNING | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
path: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
if-no-files-found: error | |
npsim-gun-EcalLumiSpec: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
particle: [e] | |
detector_config: [ip6_extended] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Get detector info | |
id: detector_info | |
run: | | |
grep epic/nightly /cvmfs/singularity.opensciencegrid.org/eicweb/jug_xl\:nightly/etc/jug_info | sed 's/.*: .*-\(.*\)/hash=\1/g' >> $GITHUB_OUTPUT | |
- name: Retrieve simulation files | |
id: retrieve_simulation_files | |
uses: actions/cache@v4 | |
with: | |
path: sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root | |
key: sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root-${{ steps.detector_info.outputs.hash }} | |
- name: Produce simulation files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.retrieve_simulation_files.outputs.cache-hit != 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
python src/tests/LUMISPECCAL_test/TwoElectronsTopCAL.py genParticles.hepmc | |
npsim --compactFile ${DETECTOR_PATH}/${DETECTOR}_${{ matrix.detector_config }}.xml --inputFiles genParticles.hepmc --random.seed 1 --outputFile sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root -N 100 -v WARNING | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root | |
path: sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root | |
if-no-files-found: error | |
npsim-dis: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
beam: [5x41, 10x100, 18x275] | |
minq2: [1, 1000] | |
detector_config: [craterlake] | |
exclude: | |
- beam: 5x41 | |
minq2: 1000 | |
steps: | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Get detector info | |
id: detector_info | |
run: | | |
grep epic/nightly /cvmfs/singularity.opensciencegrid.org/eicweb/jug_xl\:nightly/etc/jug_info | sed 's/.*: .*-\(.*\)/hash=\1/g' >> $GITHUB_OUTPUT | |
- name: Retrieve simulation files | |
id: retrieve_simulation_files | |
uses: actions/cache@v4 | |
with: | |
path: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root | |
key: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root-${{ steps.detector_info.outputs.hash }} | |
- name: Produce simulation files | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.retrieve_simulation_files.outputs.cache-hit != 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
url=root://dtn-eic.jlab.org//work/eic2/EPIC/EVGEN/DIS/NC/${{matrix.beam}}/minQ2=${{matrix.minq2}}/pythia8NCDIS_${{matrix.beam}}_minQ2=${{matrix.minq2}}_beamEffects_xAngle=-0.025_hiDiv_1.hepmc3.tree.root | |
npsim --compactFile ${DETECTOR_PATH}/${DETECTOR}_${{ matrix.detector_config }}.xml -N 100 --inputFiles ${url} --random.seed 1 --outputFile sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -v WARNING | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root | |
path: sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root | |
if-no-files-found: error | |
eicrecon-two-stage-running: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-gun | |
strategy: | |
matrix: | |
CC: [gcc] | |
particle: [e] | |
detector_config: [craterlake] | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Unarchive install directory | |
run: tar -xaf install.tar.zst | |
- name: Download simulation input | |
uses: actions/download-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
- name: Setup cvmfs | |
uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Run EICrecon (digitization) | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}} | |
$PWD/install/bin/eicrecon -Ppodio:output_collections=EventHeader,MCParticles,EcalBarrelScFiRawHits,EcalBarrelImagingRawHits -Ppodio:output_file=two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
- name: Upload digitization output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
path: two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
if-no-files-found: error | |
- name: Run EICrecon (reconstruction) | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}} | |
$PWD/install/bin/eicrecon -Ppodio:output_collections=EcalBarrelClusters,EcalBarrelClusterAssociations -Ppodio:output_file=two_stage_rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root two_stage_raw_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
- name: Upload reconstruction output | |
uses: actions/upload-artifact@v4 | |
with: | |
name: two_stage_rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
path: two_stage_rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
if-no-files-found: error | |
eicrecon-eicmkplugin: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-gun | |
strategy: | |
matrix: | |
CC: [gcc] | |
particle: [e] | |
detector_config: [craterlake] | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Unarchive install directory | |
run: tar -xaf install.tar.zst | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Run EICrecon | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}} | |
$PWD/install/bin/eicmkplugin.py MyCustomPlugin | |
cmake -S MyCustomPlugin -B MyCustomPlugin/build -DEICrecon_ROOT=$PWD/install -DUSER_PLUGIN_OUTPUT_DIRECTORY=$PWD/install/lib/EICrecon/plugins | |
cmake --build MyCustomPlugin/build -j $(getconf _NPROCESSORS_ONLN) --target install | |
$PWD/install/bin/eicrecon -Pplugins=MyCustomPlugin -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
eicrecon-benchmarks-plugins: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-gun | |
strategy: | |
matrix: | |
CC: [gcc] | |
particle: [e] | |
detector_config: [craterlake] | |
benchmark_plugins: | |
- EcalBarrelScFiCheck | |
- femc_studies | |
- lfhcal_studies | |
- tof_efficiency | |
- TRACKINGcheck | |
- tracking_efficiency | |
- tracking_occupancy | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Unarchive install directory | |
run: tar -xaf install.tar.zst | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Run EICrecon | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins${JANA_PLUGIN_PATH:+:${JANA_PLUGIN_PATH}} | |
$PWD/install/bin/eicrecon -Pplugins=${{ matrix.benchmark_plugins }} -Phistsfile=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}_${{ matrix.benchmark_plugins }}.hists.root -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}_${{ matrix.benchmark_plugins }}.hists.root | |
path: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}_${{ matrix.benchmark_plugins }}.hists.root | |
if-no-files-found: error | |
eicrecon-gun: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-gun | |
strategy: | |
matrix: | |
CC: [clang] | |
particle: [pi, e] | |
detector_config: [craterlake] | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Uncompress install directory | |
run: tar -xaf install.tar.zst | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Check dynamic library loader paths | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
ldd -r install/lib/*.so install/lib/EICrecon/plugins/*.so | |
- name: Run EICrecon | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins | |
$PWD/install/bin/eicrecon -Ppodio:output_file=rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4hep.root -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
dot -Tsvg jana.dot > jana.svg | |
mv jana.dot rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot | |
mv jana.svg rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.svg | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
path: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json | |
path: ${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.dot | |
path: | | |
*.dot | |
*.svg | |
if-no-files-found: error | |
- name: Download previous artifact | |
id: download_previous_artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
branch: ${{ github.event.pull_request.base.ref || github.ref_name }} | |
path: ref/ | |
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: warn | |
- name: Compare to previous artifacts | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH | |
mkdir capybara-reports | |
capybara bara ref/rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
mv capybara-reports rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} | |
touch .rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} | |
- uses: actions/upload-artifact@v4 | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
name: rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.capy | |
path: | | |
.rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }} | |
rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}/ | |
if-no-files-found: error | |
- name: Checkout epic-capybara | |
uses: actions/checkout@v4 | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
repository: 'eic/epic-capybara' | |
path: epic-capybara | |
- name: Compare to previous artifacts (local capybara) | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
echo "::group::diff ref -> new" | |
python3 ${{ github.workspace }}/epic-capybara/bara.py ref/rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root rec_${{ matrix.particle }}_1GeV_20GeV_${{ matrix.detector_config }}.edm4eic.root | |
echo "::endgroup::" | |
eicrecon-gun-EcalLumiSpec: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-gun-EcalLumiSpec | |
strategy: | |
matrix: | |
CC: [clang] | |
particle: [e] | |
detector_config: [ip6_extended] | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Unarchive install directory | |
run: tar -xaf install.tar.zst | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Run EICrecon | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins | |
$PWD/install/bin/eicrecon -Ppodio:output_file=rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root sim_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4hep.root -Ppodio:output_include_collections=EcalLumiSpecRawHits,EcalLumiSpecRecHits,EcalLumiSpecClusters,EcalLumiSpecClusterAssociations -PLUMISPECCAL:EcalLumiSpecIslandProtoClusters:splitCluster=1 -Pplugins=dump_flags,janadot -Pdump_flags:json=${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root | |
path: rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.edm4eic.root | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json | |
path: ${{ matrix.particle }}_${{ matrix.detector_config }}_flags.json | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_${{ matrix.particle }}_EcalLumiSpec_${{ matrix.detector_config }}.dot | |
path: jana.dot | |
if-no-files-found: error | |
eicrecon-dis: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- npsim-dis | |
strategy: | |
matrix: | |
CC: [clang] | |
beam: [5x41, 10x100, 18x275] | |
minq2: [1, 1000] | |
detector_config: [craterlake] | |
exclude: | |
- beam: 5x41 | |
minq2: 1000 | |
steps: | |
- name: Checkout .github | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: .github | |
- name: Download install directory | |
uses: actions/download-artifact@v4 | |
with: | |
name: install-${{ matrix.CC }}-eic-shell-Release | |
- name: Unarchive install directory | |
run: tar -xaf install.tar.zst | |
- uses: actions/download-artifact@v4 | |
with: | |
name: sim_dis_${{ matrix.beam }}_minQ2=${{ matrix.minq2 }}_${{ matrix.detector_config }}.edm4hep.root | |
- uses: cvmfs-contrib/github-action-cvmfs@v4 | |
- name: Run EICrecon | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
export DETECTOR_CONFIG=${DETECTOR}_${{ matrix.detector_config }} | |
export LD_LIBRARY_PATH=$PWD/install/lib:$LD_LIBRARY_PATH | |
export JANA_PLUGIN_PATH=$PWD/install/lib/EICrecon/plugins:/usr/local/plugins | |
$PWD/install/bin/eicrecon -Ppodio:output_file=rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root sim_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4hep.root -Pplugins=janadot -Pjana:warmup_timeout=0 -Pjana:timeout=0 | |
dot -Tsvg jana.dot > jana.svg | |
mv jana.dot rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.dot | |
mv jana.svg rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.svg | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root | |
path: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.dot | |
path: | | |
*.dot | |
*.svg | |
if-no-files-found: error | |
- name: Download previous artifact | |
id: download_previous_artifact | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
branch: ${{ github.event.pull_request.base.ref || github.ref_name }} | |
path: ref/ | |
name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: warn | |
- name: Compare to previous artifacts | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
pip install 'pygithub>=2' 'bokeh>=3' | |
export PYTHONPATH=$HOME/.local/lib/python3.10/site-packages:$PYTHONPATH | |
mkdir capybara-reports | |
capybara bara ref/rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root | |
mv capybara-reports rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} | |
touch .rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} | |
- uses: actions/upload-artifact@v4 | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
name: rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.capy | |
path: | | |
.rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }} | |
rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}/ | |
if-no-files-found: error | |
- name: Checkout epic-capybara | |
uses: actions/checkout@v4 | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
repository: 'eic/epic-capybara' | |
path: epic-capybara | |
- name: Build and install epic-capybara | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
run: | | |
pip install hatch | |
cd epic-capybara | |
hatch build | |
pip install dist/*.whl | |
- name: Compare to previous artifacts (local capybara) | |
uses: eic/run-cvmfs-osg-eic-shell@main | |
if: steps.download_previous_artifact.outputs.found_artifact == 'true' | |
with: | |
platform-release: "${{ env.platform-release }}" | |
setup: "/opt/detector/epic-${{ env.detector-version }}/setup.sh" | |
run: | | |
echo "::group::pip install" | |
python3 -m pip install -r ${{ github.workspace }}/.github/requirements.txt | |
echo "::endgroup::" | |
echo "::group::diff ref -> new" | |
python3 ${{ github.workspace }}/epic-capybara/bara.py ref/rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root rec_dis_${{matrix.beam}}_minQ2=${{matrix.minq2}}_${{ matrix.detector_config }}.edm4eic.root | |
echo "::endgroup::" | |
trigger-container: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name != 'merge_group' && github.actor != 'dependabot[bot]' }} | |
needs: | |
- eicrecon-gun | |
steps: | |
- uses: eic/trigger-gitlab-ci@v2 | |
id: trigger | |
with: | |
url: https://eicweb.phy.anl.gov | |
project_id: 290 | |
token: ${{ secrets.EICWEB_CONTAINER_TRIGGER }} | |
ref_name: master | |
variables: | | |
GITHUB_REPOSITORY=${{ github.repository }} | |
GITHUB_SHA=${{ github.event.pull_request.head.sha || github.sha }} | |
GITHUB_PR=${{ github.event.pull_request.number }} | |
EICRECON_VERSION="${{ github.event.pull_request.head.ref || github.ref_name }}" | |
- run: | | |
gh api \ | |
--method POST \ | |
-H "Accept: application/vnd.github+json" \ | |
/repos/${{ github.repository }}/statuses/${{ github.event.pull_request.head.sha || github.sha }} \ | |
-f state="pending" \ | |
-f target_url="${{ steps.trigger.outputs.web_url }}" \ | |
-f description="Triggered... $(TZ=America/New_York date)" \ | |
-f context="eicweb/eic_container" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build-docs: | |
runs-on: ubuntu-latest | |
needs: | |
- eicrecon-gun | |
- eicrecon-dis | |
container: | |
image: alpine:latest | |
volumes: | |
- /home/runner/work/_temp:/home/runner/work/_temp | |
# FIXME hard-coded: see https://github.com/actions/upload-pages-artifact/pull/14 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy docs | |
run: | | |
cp -r docs publishing_docs | |
- name: Run Doxygen | |
if: github.ref_name == 'main' | |
run: | | |
apk add doxygen graphviz ttf-freefont | |
doxygen Doxyfile | |
mv html publishing_docs/doxygen | |
- uses: actions/upload-artifact/merge@v4 | |
with: | |
name: jana.dot | |
pattern: | | |
*.dot | |
delete-merged: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: jana.dot | |
path: publishing_docs/dot/ | |
- uses: actions/upload-artifact/merge@v4 | |
with: | |
name: capybara | |
pattern: | | |
*.capy | |
delete-merged: true | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: publishing_docs/ | |
if-no-files-found: error | |
list-open-prs: | |
runs-on: ubuntu-latest | |
outputs: | |
json: ${{ steps.remap.outputs.json }} | |
steps: | |
- uses: octokit/[email protected] | |
id: query | |
with: | |
route: GET /repos/${{ github.repository }}/pulls?state=open | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Remap open PRs | |
id: remap | |
uses: nickofthyme/object-remap@v2 | |
with: | |
__case: snake | |
include.*.pr: ${{ toJSON(fromJSON(steps.query.outputs.data).*.number) }} | |
include.*.head_sha: ${{ toJSON(fromJSON(steps.query.outputs.data).*.head.sha) }} | |
get-docs-from-open-prs: | |
runs-on: ubuntu-latest | |
needs: | |
- build-docs | |
- list-open-prs | |
strategy: | |
matrix: ${{ fromJSON(needs.list-open-prs.outputs.json) }} | |
fail-fast: false | |
max-parallel: 4 | |
steps: | |
- name: Download docs artifact (other PRs) | |
uses: dawidd6/action-download-artifact@v3 | |
if: github.event.pull_request.number != matrix.pr | |
with: | |
commit: ${{ matrix.head_sha }} | |
path: publishing_docs/pr/${{ matrix.pr }}/ | |
name: docs | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: ignore | |
- name: Download docs artifact (this PR) | |
uses: actions/download-artifact@v4 | |
if: github.event.pull_request.number == matrix.pr | |
with: | |
name: docs | |
path: publishing_docs/pr/${{ matrix.pr }}/ | |
- name: Download capybara artifact (other PRs) | |
id: download_capybara | |
uses: dawidd6/action-download-artifact@v3 | |
if: github.event.pull_request.number != matrix.pr | |
with: | |
commit: ${{ matrix.head_sha }} | |
path: publishing_docs/pr/${{ matrix.pr }}/capybara/ | |
name: capybara | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: ignore | |
- name: Download capybara artifact (this PR) | |
uses: actions/download-artifact@v4 | |
if: github.event.pull_request.number == matrix.pr | |
with: | |
name: capybara | |
path: publishing_docs/pr/${{ matrix.pr }}/capybara/ | |
- name: Remove doxygen in PR | |
run: rm -rf publishing_docs/pr/*/doxygen | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages-staging-pr-${{ matrix.pr }} | |
path: publishing_docs/ | |
if-no-files-found: ignore | |
get-docs-from-main: | |
runs-on: ubuntu-latest | |
needs: | |
- build-docs | |
steps: | |
# Note: | |
# - If we run this on a non-main branch, we download from main with action-download-artifact. | |
# - If we run this on the main branch, we have to download from this pipeline with download-artifact. | |
- name: Download docs artifact (in PR) | |
uses: dawidd6/action-download-artifact@v3 | |
if: github.ref_name != 'main' | |
with: | |
branch: main | |
path: publishing_docs/ | |
name: docs | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: fail | |
- name: Download docs artifact (on main) | |
uses: actions/download-artifact@v4 | |
if: github.ref_name == 'main' | |
with: | |
name: docs | |
path: publishing_docs/ | |
- name: Download capybara artifact (in PR) | |
id: download_capybara | |
uses: dawidd6/action-download-artifact@v3 | |
if: github.ref_name != 'main' | |
with: | |
commit: ${{ matrix.head_sha }} | |
path: publishing_docs/capybara/ | |
name: capybara | |
workflow: ".github/workflows/linux-eic-shell.yml" | |
workflow_conclusion: "completed" | |
if_no_artifact_found: ignore | |
- name: Download capybara artifact (on main) | |
uses: actions/download-artifact@v4 | |
if: github.ref_name == 'main' | |
with: | |
name: capybara | |
path: publishing_docs/capybara/ | |
- name: Populate capybara summary (on main) | |
if: github.ref_name == 'main' || steps.download_capybara.outputs.found_artifact == 'true' | |
run: | | |
echo "### Capybara summary for main" >> publishing_docs/capybara/index.md | |
find publishing_docs/capybara/ -mindepth 1 -maxdepth 1 -type d -printf \ | |
"- [%f](https://eicrecon.epic-eic.org/capybara/%f/index.html)\n" | sort >> publishing_docs/capybara/index.md | |
- name: Create capybara step summary (this PR) | |
if: github.ref_name == 'main' | |
run: | | |
cat publishing_docs/capybara/index.md >> $GITHUB_STEP_SUMMARY | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: github-pages-staging-main | |
path: publishing_docs/ | |
if-no-files-found: error | |
collect-docs: | |
runs-on: ubuntu-latest | |
needs: | |
- get-docs-from-main | |
- get-docs-from-open-prs | |
container: | |
image: alpine:latest | |
volumes: | |
- /home/runner/work/_temp:/home/runner/work/_temp | |
# FIXME hard-coded: see https://github.com/actions/upload-pages-artifact/pull/14 | |
steps: | |
- name: Merge GitHub Pages staging artifact | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: github-pages-staging | |
pattern: | | |
github-pages-staging-* | |
delete-merged: true | |
- name: Download GitHub Pages staging artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: github-pages-staging | |
path: publishing_docs/ | |
- name: Make PR summary page | |
run: | | |
echo "### PRs" >> publishing_docs/pr/index.md | |
find publishing_docs/pr -mindepth 1 -maxdepth 1 -type d -printf "- [%f](%f/index.md)\n" | sort >> publishing_docs/pr/index.md | |
- name: List content to publish | |
run: | |
find publishing_docs/ | |
- run: | |
apk add tar bash findutils | |
# FIXME bash not really required: see https://github.com/actions/upload-pages-artifact/pull/14 | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: publishing_docs/ | |
retention-days: 7 | |
- name: Populate capybara summary | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
echo "### Capybara summary for PR ${{ github.event.pull_request.number }}" >> capybara_${{ github.event.pull_request.number }}.md | |
find publishing_docs/pr/${{ github.event.pull_request.number }}/capybara/ -mindepth 1 -maxdepth 1 -type d -printf \ | |
"- [%f](https://eicrecon.epic-eic.org/pr/${{ github.event.pull_request.number }}/capybara/%f/index.html)\n" | sort >> capybara_${{ github.event.pull_request.number }}.md | |
echo "<sup><sub>Last updated $(TZ=America/New_York date -Iminutes) ${{github.event.pull_request.head.sha}}</sub></sup>" >> capybara_${{ github.event.pull_request.number }}.md | |
- name: Create capybara step summary | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
cat capybara_${{ github.event.pull_request.number }}.md >> $GITHUB_STEP_SUMMARY | |
- name: Upload capybara summary | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: capybara_${{ github.event.pull_request.number }}.md | |
path: capybara_${{ github.event.pull_request.number }}.md | |
deploy-docs: | |
needs: | |
- collect-docs | |
permissions: | |
pages: write | |
id-token: write | |
pull-requests: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
- name: Find capybara comment | |
if: ${{ github.event_name == 'pull_request' }} | |
id: find_comment | |
uses: peter-evans/find-comment@v3 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: Capybara summary | |
- name: Fetch capybara summary | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: capybara_${{ github.event.pull_request.number }}.md | |
- name: Create or update capybara comment | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
comment-id: ${{ steps.find_comment.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body-file: capybara_${{ github.event.pull_request.number }}.md | |
edit-mode: replace |