diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 45624881a..c711d8d20 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -28,12 +28,14 @@ jobs: runs-on: ubuntu-latest 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: aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws_ssh_key: ${{ secrets.AWS_SSH_KEY }} holodeck_config: "tests/e2e/infra/aws.yaml" + - name: Run e2e tests env: KUBECONFIG: ${{ github.workspace }}/kubeconfig @@ -49,6 +52,7 @@ jobs: LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs run: | make test-e2e + - name: Archive test logs if: ${{ failure() }} uses: actions/upload-artifact@v4 @@ -56,3 +60,17 @@ jobs: name: e2e-test-logs path: ./e2e_logs/ retention-days: 15 + + - name: Send Slack alert notification + id: slack + if: ${{ failure() }} + 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: | + :red_target: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. + + Details: ${{ env.SUMMARY_URL }} diff --git a/.github/workflows/staging_e2e.yaml b/.github/workflows/staging_e2e.yaml index 754a367e5..8b6d30e55 100644 --- a/.github/workflows/staging_e2e.yaml +++ b/.github/workflows/staging_e2e.yaml @@ -28,14 +28,16 @@ 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 GOLANG_VERSION=$(./hack/golang-version.sh) echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV + - name: Set up Holodeck uses: NVIDIA/holodeck@v0.2.3 with: @@ -43,14 +45,17 @@ jobs: vsphere_password: ${{ secrets.VSPHERE_PASSWORD }} vsphere_ssh_key: ${{ secrets.VSPHERE_SSH_KEY }} holodeck_config: "tests/e2e/infra/vsphere.yaml" + - name: Intall dependencies run: | sudo apt-get update sudo apt-get install -y make + - name: Install Go uses: actions/setup-go@v5 with: go-version: ${{ env.GOLANG_VERSION }} + - name: Run e2e tests env: KUBECONFIG: ${{ github.workspace }}/kubeconfig @@ -59,6 +64,7 @@ jobs: LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs run: | make test-e2e + - name: Archive test logs if: ${{ failure() }} uses: actions/upload-artifact@v4 @@ -66,3 +72,17 @@ jobs: name: e2e-test-logs path: ./e2e_logs/ retention-days: 15 + + - name: Send Slack alert notification + id: slack + if: ${{ failure() }} + 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: | + :red_target: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. + + Details: ${{ env.SUMMARY_URL }}