diff --git a/.github/workflows/convert-to-step.yml b/.github/workflows/convert-to-step.yml new file mode 100644 index 0000000..2152244 --- /dev/null +++ b/.github/workflows/convert-to-step.yml @@ -0,0 +1,70 @@ +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 + +permissions: + contents: read + actions: read + +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 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 + 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 + 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..65b838e 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_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' }}" + merge-npsim-capybara: runs-on: ubuntu-latest needs: