Skip to content

Commit

Permalink
Only specify -x if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
FloBoJa authored Apr 16, 2024
1 parent 93fbb82 commit b2d7cff
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ inputs:
rules_path:
description: "The location of additional project specific rules"
required: false
default: "."
benchmark:
description: "Whether use hyperfine to benchmark the execution of the retriever, otherwise just the one time execution time is reported"
required: false
Expand Down Expand Up @@ -201,12 +200,21 @@ runs:
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
sudo dpkg -i hyperfine_1.16.1_amd64.deb
- name: Prepare Retriever Command
shell: bash
env:
RETRIEVER_COMMAND: './eclipse -nosplash -i "${{ github.workspace }}/${{ inputs.source_path }}" -o "${{ env.tmp_dir }}/eclipse_tmp" -r "${{ inputs.rules }}"'
run: |
if [[ "${{ inputs.rules_path }}" != '' ]]; then
RETRIEVER_COMMAND="${RETRIEVER_COMMAND} -x \"${{ github.workspace }}/${{ inputs.rules_path }}\""
fi
echo "retriever_command=$RETRIEVER_COMMAND" >> $GITHUB_ENV
- name: Execute Retriever
shell: bash
working-directory: ${{ env.tmp_dir }}/retriever
env:
NO_AT_BRIDGE: 1 # avoid eclipse error "AT-SPI: Error retrieving accessibility bus address"
RETRIEVER_COMMAND: './eclipse -nosplash -i "${{ github.workspace }}/${{ inputs.source_path }}" -o "${{ env.tmp_dir }}/eclipse_tmp" -r "${{ inputs.rules }}" -x "${{ inputs.rules_path }}"'
TIMING_INFO_FILE: ${{ env.tmp_dir }}/retriever_out/timing.md
run: |
echo "TIMING_INFO_FILE=$TIMING_INFO_FILE" >> $GITHUB_ENV
Expand All @@ -223,7 +231,7 @@ runs:
rm -rf "${{ env.tmp_dir }}/eclipse_tmp"; sleep 1; \
rm -rf "${{ env.tmp_dir }}/retriever/workspace"; sleep 1; \
echo "cleanup done"' \
"$RETRIEVER_COMMAND"
"${{ env.retriever_command }}"
# Remove the first column from the table using sed
sed -i 's/^[^|]*|[^|]*|/|/' $TIMING_INFO_FILE
Expand All @@ -234,7 +242,7 @@ runs:
else
# Execute with /usr/bin/time
/usr/bin/time -p -o "$TIMING_INFO_FILE" $RETRIEVER_COMMAND
/usr/bin/time -p -o "$TIMING_INFO_FILE" ${{ env.retriever_command }}
# Read and reformat the timing information
{
echo "## Retriever execution time"
Expand Down

0 comments on commit b2d7cff

Please sign in to comment.