mrproliu commented on a change in pull request #62:
URL:
https://github.com/apache/skywalking-infra-e2e/pull/62#discussion_r739745694
##########
File path: action.yaml
##########
@@ -30,5 +33,46 @@ runs:
make -C $GITHUB_ACTION_PATH docker
docker run -v $(pwd):/tmp -w /tmp --entrypoint=sh
docker.io/apache/e2e:latest -c "cp /usr/local/bin/e2e /tmp/e2e"
install ./e2e /usr/local/bin
+ - name: E2E Dir Generator
+ id: 'e2e-dir-generator'
+ shell: bash
+ run: |
+ WORK_DIR="${{ runner.temp }}/skywalking-infra-e2e"
+ echo "::set-output name=work::$WORK_DIR"
+
+ LOG_DIR=""
+ LOG_JOB_DIR=""
+ if [[ "${{ inputs.log-dir }}" == "" ]]
+ then
+ matrix='${{ toJSON(matrix) }}'
+ if [[ "$matrix" == "null" ]]
+ then
+ LOG_DIR="$WORK_DIR/logs"
+ LOG_JOB_DIR="$LOG_DIR/${{ github.job }}"
+ else
+ combine_matrix=$(echo $matrix|jq -r
'to_entries|map(.value)|tostring')
+ # remove json syntax
+ combine_matrix=`echo $combine_matrix|sed -e 's/\[\|\]\|\"//g'`
+ combine_matrix=`echo $combine_matrix|sed -e 's/[\{|\}]//g'`
+ # replace to path
+ combine_matrix=`echo $combine_matrix|sed -e 's/[^A-Za-z0-9_-]/_/g'`
+ LOG_DIR="$WORK_DIR/logs"
+ LOG_JOB_DIR="$LOG_DIR/${{ github.job }}_$combine_matrix"
+ fi
+ elif [[ "${{ inputs.log-dir }}" == /* ]]
+ then
+ LOG_DIR="${{ inputs.log-dir }}"
+ LOG_JOB_DIR="${{ inputs.log-dir }}"
+ else
+ LOG_DIR="$WORK_DIR/${{ inputs.log-dir }}"
+ LOG_JOB_DIR="$WORK_DIR/${{ inputs.log-dir }}"
+ fi
+ echo "::set-output name=log::$LOG_DIR"
+ echo "::set-output name=log-case::$LOG_JOB_DIR"
+ echo "SW_INFRA_E2E_LOG_DIR=$LOG_DIR" >> $GITHUB_ENV
Review comment:
Yes, I only set the log directory into the env var, because I cannot
read the output from the job setting.
Please read this Job output, I print the environment context, including
`github`, `matrix`, and `steps`. I cannot find the output in the steps.
https://github.com/mrproliu/skywalking/runs/4049804581?check_suite_focus=true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]