Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter test slack report update #47

Merged
merged 17 commits into from
Sep 15, 2022
74 changes: 28 additions & 46 deletions .github/workflows/jupyter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
echo "OPS_SUCCESS_FILE=ops_success.txt" >> $GITHUB_ENV
echo "UAT_FAILURE_FILE=uat_fail.txt" >> $GITHUB_ENV
echo "OPS_FAILURE_FILE=ops_fail.txt" >> $GITHUB_ENV
echo "SLACK_REPORT_CONTENT=" >> $GITHUB_ENV
- name: Set environment variables for notebook
run: |
echo "OPS_USERNAME=${{ secrets.EDL_USER }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -84,61 +85,42 @@ jobs:
echo "Success Content: $(cat ${{ env.OUTPUT_DIR }}/${{ env.OPS_SUCCESS_FILE }} | sed 's/$/,/' | tr '\n' ' ')"
echo
echo "Failed Content: $(cat ${{ env.OUTPUT_DIR }}/${{ env.OPS_FAILURE_FILE }} | sed 's/$/,/' | tr '\n' ' ')"
- name: Send report for UAT check - SUCCESS
uses: slackapi/slack-github-action@v1.21.0
- name: Slack Report update - Add info for UAT check - SUCCESS
if: |
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test UAT result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.SUCCESS_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for UAT check - FAILURE
uses: slackapi/slack-github-action@v1.21.0
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test UAT result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.SUCCESS_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add info for UAT check - FAILURE
if: |
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for OPS check - SUCCESS
uses: slackapi/slack-github-action@v1.21.0
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n" >> $GITHUB_ENV
${{ env.SLACK_REPORT_CONTENT }} += "Jupyter-test UAT result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_UAT_output_files.outputs.FAIL_CONTENT }}\n"
- name: Slack Report update - Add info for OPS check - SUCCESS
if: |
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test OPS result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.SUCCESS_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Send report for OPS check - FAILURE
uses: slackapi/slack-github-action@v1.21.0
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test OPS result: SUCCESS\nSuccessfully ran Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.SUCCESS_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add info for OPS check - FAILURE
if: |
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
with:
payload: |
{
"status": "Jupyter-test OPS result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.FAIL_CONTENT }}\n"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
- name: Add link to slack report
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nJupyter-test OPS result: FAILURE\nFailed to run Concise Notebook on the following collections:\n${{ steps.check_OPS_output_files.outputs.FAIL_CONTENT }}\n" >> $GITHUB_ENV
- name: Slack Report update - Add action link on Failure
if: |
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
run: |
echo "SLACK_REPORT_CONTENT=${{ env.SLACK_REPORT_CONTENT }}\nExecution link:\ngithub.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
echo ${{ env.SLACK_REPORT_CONTENT }}
- name: Send Report to Slack
uses: slackapi/slack-github-action@v1.21.0
if: |
steps.check_UAT_output_files.outputs.SUCCESS_EXISTS == 'true' ||
steps.check_UAT_output_files.outputs.FAIL_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.SUCCESS_EXISTS == 'true' ||
steps.check_OPS_output_files.outputs.FAIL_EXISTS == 'true'
env.SLACK_REPORT_CONTENT != ''
with:
payload: |
{
"status": "Execution link:\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"status": "${{ env.SLACK_REPORT_CONTENT }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BOT_WEBHOOK }}
Expand Down