/.github/{scripts,workflows}: print logs on failure, iterating on pull request comment

This commit is contained in:
Dustin Brown
2021-01-05 10:41:06 -08:00
parent a4b8fe2086
commit 33f39f70fe
2 changed files with 18 additions and 8 deletions

View File

@@ -35,9 +35,14 @@ source "$TEMPLATE_SCRIPT" "$jobname" "$FROM_VERSION" "$TO_VERSION" "$timeprefix"
KUBECONFIG="$KUBECONFIG" kubectl apply -f job.json
KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n performance-benchmarking --timeout=600s
out=$(KUBECONFIG="$KUBECONFIG" kubectl wait job/"$jobname" --for=condition=complete -n performance-benchmarking --timeout=600s)
if [ "$out" != "job.batch/$jobname condition met" ]; then
KUBECONFIG="$KUBECONFIG" kubectl logs job/"$jobname" -n performance-benchmarking
else
echo "::set-output name=object-key::$timeprefix/$actorprefix/compare-results.log"
fi
KUBECONFIG="$KUBECONFIG" kubectl delete job/"$jobname" -n performance-benchmarking
echo "::set-output name=object-key::$timeprefix/$actorprefix/compare-results.log"
exit 0

View File

@@ -35,12 +35,6 @@ jobs:
reaction: rocket
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Set Comment Body
# run: |
# echo "::set-output name=body::$(echo $BODY)"
# id: set_body
# env:
# BODY: ${{ steps.check.outputs.comment_body }}
- name: Set Benchmark
if: ${{ steps.check.outputs.triggered == 'true' }}
id: set_benchmark
@@ -89,7 +83,18 @@ jobs:
KUBECONFIG: "./kubeconfig"
TEMPLATE_SCRIPT: "./.github/scripts/performance-benchmarking/get-job-json.sh"
- name: Get benchmark results
id: get-results
run: |
echo "Get benchmark results here: $KEY"
aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log
echo "::set-output name=results::$(cat results.log)"
env:
KEY: ${{ steps.run-benchmarks.outputs.object-key }}
- name: View context attributes
uses: actions/github-script@v3
with:
script: |
console.log("This is body:", process.env.BODY)
console.log(context)
env:
BODY: ${{ steps.get-results.outputs.results }}