diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ab8413f3..62473a72 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,12 +28,14 @@ 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/holodeck@v0.2.3 with: @@ -41,6 +43,7 @@ jobs: 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 @@ -50,6 +53,7 @@ jobs: NGC_API_KEY: ${{ secrets.NGC_API_KEY }} run: | ./hack/e2e_tests.sh + - name: Archive test logs if: ${{ failure() }} uses: actions/upload-artifact@v4 @@ -57,3 +61,26 @@ jobs: 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/slack-github-action@v1.26.0 + 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 }}