Skip to content

Commit

Permalink
Report GHA e2e status
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Eduardo Arango Gutierrez <[email protected]>
  • Loading branch information
ArangoGutierrez committed Aug 19, 2024
1 parent d63cd37 commit c92b481
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,22 @@ jobs:
runs-on: pdx01-arc-runners
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }}
steps:
- uses: actions/checkout@v4
name: Check out code
- name: Check out code
uses: actions/checkout@v4

- name: Calculate build vars
id: vars
run: |
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
- name: Set up Holodeck
uses: NVIDIA/[email protected]
with:
vsphere_username: ${{ secrets.VSPHERE_USERNAME }}
vsphere_password: ${{ secrets.VSPHERE_PASSWORD }}
vsphere_ssh_key: ${{ secrets.VSPHERE_SSH_KEY }}
holodeck_config: "test/e2e/infra/vsphere.yml"

- name: Run e2e tests
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
Expand All @@ -50,10 +53,34 @@ jobs:
NGC_API_KEY: ${{ secrets.NGC_API_KEY }}
run: |
./hack/e2e_tests.sh
- name: Archive test logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: e2e-test-logs
path: ./e2e_logs/
retention-days: 15

- name: Check workflow status
run: |
if [ "${{ job.status }}" = "success" ]; then
STATUS_MESSAGE=":green-check-mark: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}*n has completed successfully."
else
STATUS_MESSAGE=":red_target: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed."
fi
echo "STATUS_MESSAGE=$STATUS_MESSAGE" >> $GITHUB_ENV
- name: Send Slack alert notification
id: slack
if: github.event_name == 'push'
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: |
${{ env.STATUS_MESSAGE }}
Details: ${{ env.SUMMARY_URL }}

0 comments on commit c92b481

Please sign in to comment.