|
1 | | -# Copyright 2024 NVIDIA CORPORATION |
| 1 | +# Copyright 2025 NVIDIA CORPORATION |
2 | 2 | # |
3 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
4 | 4 | # you may not use this file except in compliance with the License. |
|
15 | 15 | name: End-to-end Tests |
16 | 16 |
|
17 | 17 | on: |
18 | | - workflow_run: |
19 | | - workflows: [Image] |
20 | | - types: |
21 | | - - completed |
22 | | - branches: |
23 | | - - "pull-request/[0-9]+" |
24 | | - - main |
25 | | - - release-* |
| 18 | + workflow_call: |
| 19 | + inputs: |
| 20 | + version: |
| 21 | + required: true |
| 22 | + type: string |
| 23 | + golang_version: |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + secrets: |
| 27 | + AWS_ACCESS_KEY_ID: |
| 28 | + required: true |
| 29 | + AWS_SECRET_ACCESS_KEY: |
| 30 | + required: true |
| 31 | + AWS_SSH_KEY: |
| 32 | + required: true |
| 33 | + SLACK_BOT_TOKEN: |
| 34 | + required: true |
| 35 | + SLACK_CHANNEL_ID: |
| 36 | + required: true |
26 | 37 |
|
27 | 38 | jobs: |
28 | 39 | e2e-tests: |
29 | 40 | runs-on: linux-amd64-cpu4 |
30 | | - if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }} |
31 | 41 | steps: |
32 | | - - name: Check out code |
33 | | - uses: actions/checkout@v4 |
| 42 | + - name: Check out code |
| 43 | + uses: actions/checkout@v4 |
34 | 44 |
|
35 | | - - name: Calculate build vars |
36 | | - id: vars |
37 | | - run: | |
38 | | - echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV |
39 | | - GOLANG_VERSION=$(./hack/golang-version.sh) |
40 | | - echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV |
| 45 | + - name: Install Go |
| 46 | + uses: actions/setup-go@v5 |
| 47 | + with: |
| 48 | + go-version: ${{ inputs.golang_version }} |
41 | 49 |
|
42 | | - - name: Install Go |
43 | | - uses: actions/setup-go@v5 |
44 | | - with: |
45 | | - go-version: ${{ env.GOLANG_VERSION }} |
| 50 | + - name: Set up Holodeck |
| 51 | + |
| 52 | + with: |
| 53 | + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 54 | + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 55 | + aws_ssh_key: ${{ secrets.AWS_SSH_KEY }} |
| 56 | + holodeck_config: "tests/e2e/infra/aws.yaml" |
46 | 57 |
|
47 | | - - name: Set up Holodeck |
48 | | - |
49 | | - with: |
50 | | - aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
51 | | - aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
52 | | - aws_ssh_key: ${{ secrets.AWS_SSH_KEY }} |
53 | | - holodeck_config: "tests/e2e/infra/aws.yaml" |
| 58 | + - name: Run e2e tests |
| 59 | + env: |
| 60 | + KUBECONFIG: ${{ github.workspace }}/kubeconfig |
| 61 | + E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin |
| 62 | + E2E_IMAGE_TAG: ${{ inputs.version }}-ubi9 |
| 63 | + LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs |
| 64 | + run: | |
| 65 | + make test-e2e |
54 | 66 |
|
55 | | - - name: Run e2e tests |
56 | | - env: |
57 | | - KUBECONFIG: ${{ github.workspace }}/kubeconfig |
58 | | - E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-device-plugin |
59 | | - E2E_IMAGE_TAG: ${COMMIT_SHORT_SHA}-ubi9 |
60 | | - LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs |
61 | | - run: | |
62 | | - make test-e2e |
| 67 | + - name: Archive test logs |
| 68 | + if: ${{ failure() }} |
| 69 | + uses: actions/upload-artifact@v4 |
| 70 | + with: |
| 71 | + name: e2e-test-logs |
| 72 | + path: ./e2e_logs/ |
| 73 | + retention-days: 15 |
63 | 74 |
|
64 | | - - name: Archive test logs |
65 | | - if: ${{ failure() }} |
66 | | - uses: actions/upload-artifact@v4 |
67 | | - with: |
68 | | - name: e2e-test-logs |
69 | | - path: ./e2e_logs/ |
70 | | - retention-days: 15 |
| 75 | + - name: Send Slack alert notification |
| 76 | + id: slack |
| 77 | + if: false |
| 78 | + |
| 79 | + env: |
| 80 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
| 81 | + SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
| 82 | + with: |
| 83 | + channel-id: ${{ secrets.SLACK_CHANNEL_ID }} |
| 84 | + slack-message: | |
| 85 | + :x: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. |
71 | 86 |
|
72 | | - - name: Send Slack alert notification |
73 | | - if: ${{ failure() }} |
74 | | - |
75 | | - with: |
76 | | - method: chat.postMessage |
77 | | - token: ${{ secrets.SLACK_BOT_TOKEN }} |
78 | | - payload: | |
79 | | - channel: ${{ secrets.SLACK_CHANNEL_ID }} |
80 | | - text: | |
81 | | - :x: On repository ${{ github.repository }}, the Workflow *${{ github.workflow }}* has failed. |
82 | | - |
83 | | - Details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |
| 87 | + Details: ${{ env.SUMMARY_URL }} |
0 commit comments