From 0b95c12f61c9b2840c1ff2b1cf9e10a6358f89b3 Mon Sep 17 00:00:00 2001 From: Adithya Krishnan Kannan <13063254+AdithyaKrishnan@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:20:40 -0600 Subject: [PATCH] tests/e2e: Migrate e2e test for sev andsnp to GHA This PR is to migrate the AMD SEV and SNP e2e tests from Jenkins to GHA. Builds on top of PR #295 Signed-off-by: Adithya Krishnan Kannan --- .github/workflows/ccruntime-pr.yaml | 27 +++++++----- .github/workflows/ccruntime_e2e_amd.yaml | 56 ++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ccruntime_e2e_amd.yaml diff --git a/.github/workflows/ccruntime-pr.yaml b/.github/workflows/ccruntime-pr.yaml index f1993c20..73e3d845 100644 --- a/.github/workflows/ccruntime-pr.yaml +++ b/.github/workflows/ccruntime-pr.yaml @@ -1,20 +1,23 @@ name: ccruntime e2e test for PR on: - pull_request_target: - branches: - - 'main' - types: - - opened - - synchronize - - reopened - - labeled - paths-ignore: - - 'docs/**' - + pull_request_target: + branches: + - 'main' + types: + - opened + - synchronize + - reopened + - labeled + paths-ignore: + - 'docs/**' jobs: + e2e-pr-amd: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + uses: ./.github/workflows/ccruntime_e2e_amd.yaml + e2e-pr: if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} uses: ./.github/workflows/ccruntime_e2e.yaml with: target-branch: ${{ github.event.pull_request.base.ref }} - commit-hash: ${{ github.event.pull_request.head.sha }} + commit-hash: ${{ github.event.pull_request.head.sha }} \ No newline at end of file diff --git a/.github/workflows/ccruntime_e2e_amd.yaml b/.github/workflows/ccruntime_e2e_amd.yaml new file mode 100644 index 00000000..dce5ad0c --- /dev/null +++ b/.github/workflows/ccruntime_e2e_amd.yaml @@ -0,0 +1,56 @@ +name: ccruntime e2e tests amd sev +on: + workflow_call: + +permissions: + contents: read + +jobs: + e2e: + name: operator tests + strategy: + fail-fast: false + matrix: + runtimeclass: + - "kata-qemu-sev" + - "kata-qemu-snp" + instance: + - "coco-ci-amd-rome-001" + - "coco-ci-amd-milan-001" + exclude: + - runtimeclass: "kata-qemu-snp" + instance: "coco-ci-amd-rome-001" + - runtimeclass: "kata-qemu-sev" + instance: "coco-ci-amd-milan-001" + + runs-on: [self-hosted] + steps: + - name: Take a pre-action for self-hosted runner + run: | + if [ -f ${HOME}/script/pre_action.sh ]; then + ${HOME}/script/pre_action.sh cc-operator + fi + + - uses: actions/checkout@v4 + + - name: Install deps + run: | + sudo apt-get update -y + sudo apt-get install -y ansible python-is-python3 + + - name: Run e2e tests + timeout-minutes: 45 + run: | + cd tests/e2e + export PATH="$PATH:/usr/local/bin" + args="-u" + ./run-local.sh -r "${{ matrix.runtimeclass }}" "${args}" + env: + RUNNING_INSTANCE: ${{ matrix.instance }} + + - name: Take a post-action + if: always() + run: | + if [ -f ${HOME}/script/post_action.sh ]; then + ${HOME}/script/post_action.sh cc-operator + fi \ No newline at end of file