From a2e0d364ec9b708a78d79d389fb834891850bc19 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 02:03:21 +0000 Subject: [PATCH 1/9] ci: add STEP export workflow test Agent-Logs-Url: https://github.com/eic/npsim/sessions/c0678f12-df55-4bde-a156-5eb7f26367c8 Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- .github/workflows/convert-to-step.yml | 66 +++++++++++++++++++++++++++ .github/workflows/linux-eic-shell.yml | 10 ++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/convert-to-step.yml diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml new file mode 100644 index 0000000..eaa3534 --- /dev/null +++ b/.github/workflows/convert-to-step.yml @@ -0,0 +1,66 @@ +name: Convert to STEP + +on: + workflow_call: + inputs: + detector_configs: + required: true + type: string + install_artifact_name: + required: true + type: string + organization: + required: false + type: string + default: eicweb + platform-release: + required: false + type: string + default: eic_xl:nightly + epic_setup_script: + required: false + type: string + default: /opt/detector/epic-main/bin/thisepic.sh + +jobs: + convert-to-step: + runs-on: ubuntu-latest + strategy: + matrix: + detector_config: ${{fromJson(inputs.detector_configs)}} + steps: + - uses: actions/checkout@v6 + - uses: actions/download-artifact@v8 + with: + name: ${{ inputs.install_artifact_name }} + path: . + - name: Uncompress install artifact + run: tar -xaf install.tar.zst + - uses: cvmfs-contrib/github-action-cvmfs@v5 + - uses: eic/run-cvmfs-osg-eic-shell@main + with: + organization: "${{ inputs.organization }}" + platform-release: "${{ inputs.platform-release }}" + setup: ${{ inputs.epic_setup_script }} + run: | + export DETECTOR_CACHE=/opt/detector/epic-main/share/epic + export PATH=$PWD/install/bin${PATH:+:$PATH} + export LD_LIBRARY_PATH=$PWD/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} + # For some reason npdet_to_step really wants a space in IFS + IFS=$' \n\t' + # First get all detectors (except world) + declare -A detectors + while read d ; do detectors[$d]='-l 3' ; done <<< $(npdet_to_step list $DETECTOR_PATH/${{matrix.detector_config}}.xml | sed '/world/d;s/.*(vol: \(.*\)).*/\1/g') + # Then tweak the levels (default is 1) + detectors[EcalBarrelImaging]='-l 4' + detectors[HcalBarrel]='-l 1' + detectors[LFHCAL]='-l 2' + detectors[OuterBarrelMPGDSubAssembly]='-l 4' + # Export to one STEP file + npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml 2>&1 | sed '/TGeoMatrix::dtor/d' + test -s ${{matrix.detector_config}}.stp + - uses: actions/upload-artifact@v7 + with: + name: ${{matrix.detector_config}}.stp + path: ${{matrix.detector_config}}.stp + if-no-files-found: error diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index c43b0d1..b0ba4d8 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -220,6 +220,16 @@ jobs: sim_dis_${{ matrix.beam }}_minQ2=${{ matrix.minq2 }}_${{ matrix.detector_config }}/ if-no-files-found: error + convert-to-step: + needs: + - build + uses: ./.github/workflows/convert-to-step.yml + with: + detector_configs: '["epic_ip6"]' + install_artifact_name: install-g++-eic-shell-Release-${{ env.platform }}-${{ env.release }} + organization: "${{ env.organization }}" + platform-release: "${{ env.platform }}:${{ env.release }}" + merge-npsim-capybara: runs-on: ubuntu-latest needs: From 4c38eb15d650d22b314fb8c1f358e4a08b2b1ff3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 02:04:18 +0000 Subject: [PATCH 2/9] ci: scope token permissions in step workflow Agent-Logs-Url: https://github.com/eic/npsim/sessions/c0678f12-df55-4bde-a156-5eb7f26367c8 Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com> --- .github/workflows/convert-to-step.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml index eaa3534..4175aaf 100644 --- a/.github/workflows/convert-to-step.yml +++ b/.github/workflows/convert-to-step.yml @@ -22,6 +22,9 @@ on: type: string default: /opt/detector/epic-main/bin/thisepic.sh +permissions: + contents: read + jobs: convert-to-step: runs-on: ubuntu-latest From 4da34f2c1b1d383fd2d53775ecdbf08c64af95d8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 22:16:52 -0500 Subject: [PATCH 3/9] ci: fix env context in reusable workflow call The 'env' context is not available in 'with' inputs of a reusable workflow call. Replace env.platform, env.release, and env.organization with inline expressions using the 'inputs' context with hardcoded defaults, which is the same fallback logic used in the env section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/linux-eic-shell.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index b0ba4d8..7af413e 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -226,9 +226,9 @@ jobs: uses: ./.github/workflows/convert-to-step.yml with: detector_configs: '["epic_ip6"]' - install_artifact_name: install-g++-eic-shell-Release-${{ env.platform }}-${{ env.release }} - organization: "${{ env.organization }}" - platform-release: "${{ env.platform }}:${{ env.release }}" + install_artifact_name: install-g++-eic-shell-Release-${{ inputs.platform || 'eic_xl' }}-${{ inputs.release || 'nightly' }} + organization: "${{ inputs.organization || 'eicweb' }}" + platform-release: "${{ inputs.platform || 'eic_xl' }}:${{ inputs.release || 'nightly' }}" merge-npsim-capybara: runs-on: ubuntu-latest From d5b6849dfa52b8047b4e4e872d16ed7bfbe013e3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 22:44:55 -0500 Subject: [PATCH 4/9] fix: better detector config list --- .github/workflows/linux-eic-shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 7af413e..2daeade 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -225,7 +225,7 @@ jobs: - build uses: ./.github/workflows/convert-to-step.yml with: - detector_configs: '["epic_ip6"]' + detector_configs:'["epic_craterlake_no_bhcal","epic_imaging_only","epic_drich_only","epic_dirc_only","epic_craterlake_tracking_only","epic_ip6"]' install_artifact_name: install-g++-eic-shell-Release-${{ inputs.platform || 'eic_xl' }}-${{ inputs.release || 'nightly' }} organization: "${{ inputs.organization || 'eicweb' }}" platform-release: "${{ inputs.platform || 'eic_xl' }}:${{ inputs.release || 'nightly' }}" From 674663690ae41870a92c466f84dc9b98cf2f68e7 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 22:53:06 -0500 Subject: [PATCH 5/9] fix: space --- .github/workflows/linux-eic-shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-eic-shell.yml b/.github/workflows/linux-eic-shell.yml index 2daeade..65b838e 100644 --- a/.github/workflows/linux-eic-shell.yml +++ b/.github/workflows/linux-eic-shell.yml @@ -225,7 +225,7 @@ jobs: - build uses: ./.github/workflows/convert-to-step.yml with: - detector_configs:'["epic_craterlake_no_bhcal","epic_imaging_only","epic_drich_only","epic_dirc_only","epic_craterlake_tracking_only","epic_ip6"]' + detector_configs: '["epic_craterlake_no_bhcal","epic_imaging_only","epic_drich_only","epic_dirc_only","epic_craterlake_tracking_only","epic_ip6"]' install_artifact_name: install-g++-eic-shell-Release-${{ inputs.platform || 'eic_xl' }}-${{ inputs.release || 'nightly' }} organization: "${{ inputs.organization || 'eicweb' }}" platform-release: "${{ inputs.platform || 'eic_xl' }}:${{ inputs.release || 'nightly' }}" From 0b3105b67bb5c824c10d753a9414bd7527a1458d Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 23:12:47 -0500 Subject: [PATCH 6/9] fix: permissions Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/convert-to-step.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml index 4175aaf..fb16d2b 100644 --- a/.github/workflows/convert-to-step.yml +++ b/.github/workflows/convert-to-step.yml @@ -24,6 +24,7 @@ on: permissions: contents: read + actions: read jobs: convert-to-step: From 17bf9909680023806869591b17afb72feeeeb5cf Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 23:15:27 -0500 Subject: [PATCH 7/9] fix: don't set DETECTOR_CACHE --- .github/workflows/convert-to-step.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml index fb16d2b..0b76f7c 100644 --- a/.github/workflows/convert-to-step.yml +++ b/.github/workflows/convert-to-step.yml @@ -47,7 +47,6 @@ jobs: platform-release: "${{ inputs.platform-release }}" setup: ${{ inputs.epic_setup_script }} run: | - export DETECTOR_CACHE=/opt/detector/epic-main/share/epic export PATH=$PWD/install/bin${PATH:+:$PATH} export LD_LIBRARY_PATH=$PWD/install/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} # For some reason npdet_to_step really wants a space in IFS From 7435877c13838a06a83a93a1b445e582f1a7c4bc Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 23:16:34 -0500 Subject: [PATCH 8/9] fix: set -o pipefail --- .github/workflows/convert-to-step.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml index 0b76f7c..87fbe9f 100644 --- a/.github/workflows/convert-to-step.yml +++ b/.github/workflows/convert-to-step.yml @@ -60,6 +60,7 @@ jobs: detectors[LFHCAL]='-l 2' detectors[OuterBarrelMPGDSubAssembly]='-l 4' # Export to one STEP file + set -o pipefail npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml 2>&1 | sed '/TGeoMatrix::dtor/d' test -s ${{matrix.detector_config}}.stp - uses: actions/upload-artifact@v7 From 1a40bfeac22e0757a834b1f60c702e4811ca8df6 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Tue, 19 May 2026 23:26:31 -0500 Subject: [PATCH 9/9] fix: no need for dtor drop anymore --- .github/workflows/convert-to-step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml index 87fbe9f..2152244 100644 --- a/.github/workflows/convert-to-step.yml +++ b/.github/workflows/convert-to-step.yml @@ -61,7 +61,7 @@ jobs: detectors[OuterBarrelMPGDSubAssembly]='-l 4' # Export to one STEP file set -o pipefail - npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml 2>&1 | sed '/TGeoMatrix::dtor/d' + npdet_to_step $(for d in ${!detectors[@]} ; do echo part ${detectors[$d]} $d ; done) -o ${{matrix.detector_config}} $DETECTOR_PATH/${{matrix.detector_config}}.xml test -s ${{matrix.detector_config}}.stp - uses: actions/upload-artifact@v7 with: