Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Implement ok-to-test-tdx label #9

Open
1 task
sprt opened this issue Oct 9, 2024 · 4 comments
Open
1 task

ci: Implement ok-to-test-tdx label #9

sprt opened this issue Oct 9, 2024 · 4 comments

Comments

@sprt
Copy link
Collaborator

sprt commented Oct 9, 2024

Acceptance criteria:

  • Make it so that setting the ok-to-test-tdx label only triggers the following test: kata-containers-ci-on-push / run-kata-coco-tests / run-k8s-tests-on-tdx

You will most likely want to test things in a separate repo that you own: workflows using the pull_request_target don't take into account YAML changes in PRs.

@sprt sprt converted this from a draft issue Oct 9, 2024
@chris-krenz
Copy link

I'm still in the process of testing this on my fork, but here's how it's currently implemented.

A new workflow tdx-tests-only.yaml

name: Trigger run-k8s-tests-on-tdx Only
on:
  workflow_dispatch: 
  pull_request_target:
    branches:
      - 'main'
      - 'stable-*'
    types:
      - opened
      - synchronize
      - reopened
      - labeled

jobs:
  trigger-tdx-tests:
    if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test-tdx') }}
    uses: ./.github/workflows/run-kata-coco-tests.yaml
    with:
      run_only_tdx_tests: true  # Modified run-kata-coco-tests.yaml to run only run-k8s-tests-on-tdx if invoked with this input
    secrets: inherit

This passes in the run_only_tdx_tests var to the run-kata-coco-tests.yaml workflow. For any job, except the target job, if that var is set, the job will not run.

if: ${{ !inputs.run_only_tdx_tests }}

Does that make sense?

@chris-krenz
Copy link

chris-krenz commented Nov 13, 2024

I changed to pull_request from pull_request_target and tested on my fork (just with an echo command).

Next I'll create a PR upstream and document this feature both here and in that PR.

@sprt
Copy link
Collaborator Author

sprt commented Nov 20, 2024

Just the dump info in the form of a PR - then we move on.

@chris-krenz
Copy link

Create draft PR. Will update with more explanation/documentation.

kata-containers/kata-containers#10618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants