|
| 1 | +# Copyright 2025 NVIDIA CORPORATION |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: End-to-end Tests |
| 16 | + |
| 17 | +on: |
| 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 |
| 37 | + |
| 38 | +jobs: |
| 39 | + e2e-tests: |
| 40 | + runs-on: linux-amd64-cpu4 |
| 41 | + steps: |
| 42 | + - name: Check out code |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Install Go |
| 46 | + uses: actions/setup-go@v5 |
| 47 | + with: |
| 48 | + go-version: ${{ inputs.golang_version }} |
| 49 | + |
| 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/holodeck.yaml" |
| 57 | + |
| 58 | + - name: Run e2e tests |
| 59 | + env: |
| 60 | + KUBECONFIG: ${{ github.workspace }}/kubeconfig |
| 61 | + HELM_CHART: ${{ github.workspace }}/deployments/helm/nvidia-dra-driver-gpu |
| 62 | + E2E_IMAGE_REPO: ghcr.io/nvidia/k8s-dra-driver-gpu |
| 63 | + E2E_IMAGE_TAG: ${{ inputs.version }}-ubi9 |
| 64 | + E2E_IMAGE_PULL_POLICY: IfNotPresent |
| 65 | + LOG_ARTIFACTS_DIR: ${{ github.workspace }}/e2e_logs |
| 66 | + run: | |
| 67 | + make -f tests/e2e/Makefile test-e2e |
| 68 | +
|
| 69 | + - name: Archive test logs |
| 70 | + if: ${{ failure() }} |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + name: e2e-test-logs |
| 74 | + path: ./e2e_logs/ |
| 75 | + retention-days: 15 |
| 76 | + |
| 77 | + - name: Archive Ginkgo logs |
| 78 | + uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | + name: ginkgo-logs |
| 81 | + path: ginkgo.json |
| 82 | + retention-days: 15 |
| 83 | + |
| 84 | + - name: Post text to a Slack channel |
| 85 | + if: ${{ failure() }} |
| 86 | + |
| 87 | + env: |
| 88 | + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
| 89 | + SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} |
| 90 | + with: |
| 91 | + method: chat.postMessage |
| 92 | + token: ${{ secrets.SLACK_BOT_TOKEN }} |
| 93 | + payload: | |
| 94 | + channel: ${{ secrets.SLACK_CHANNEL_ID }} |
| 95 | + text: ":x: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. |
| 96 | +
|
| 97 | + Details: ${{ env.SUMMARY_URL }}" |
0 commit comments