From 106e305717c228576994ab08bb6641d9da7f2aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 6 Jul 2023 11:39:06 +0200 Subject: [PATCH] gha: Create a re-usable `ci.yaml` file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is based on the `ci-on-push.yaml` file, and it's called from ther The reason to split on a new file is that we can easily introduce a `ci-nightly.yaml` file and re-use the `ci.yaml` file there as well. Signed-off-by: Fabiano FidĂȘncio --- .github/workflows/ci-on-push.yaml | 67 ++----------------------- .github/workflows/ci.yaml | 81 +++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci-on-push.yaml b/.github/workflows/ci-on-push.yaml index 8a7aa96732..1b10f40f65 100644 --- a/.github/workflows/ci-on-push.yaml +++ b/.github/workflows/ci-on-push.yaml @@ -17,71 +17,10 @@ env: PR_NUMBER: ${{ github.event.pull_requesst.number }} jobs: - build-kata-static-tarball-amd64: + kata-containers-ci-on-push: if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml + uses: ./.github/workflows/ci.yaml with: - tarball-suffix: -${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }} commit-hash: ${{ env.COMMIT_HASH }} - - publish-kata-deploy-payload-amd64: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: build-kata-static-tarball-amd64 - uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml - with: - tarball-suffix: -${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }} - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 - commit-hash: ${{ env.COMMIT_HASH }} - secrets: inherit - - run-k8s-tests-on-aks: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-on-aks.yaml - with: - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 - commit-hash: ${{ env.COMMIT_HASH }} - secrets: inherit - - run-k8s-tests-on-sev: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-on-sev.yaml - with: - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 - commit-hash: ${{ env.COMMIT_HASH }} - - run-k8s-tests-on-snp: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-on-snp.yaml - with: - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 pr-number: ${{ env.PR_NUMBER }} - commit-hash: ${{ env.COMMIT_HASH }} - - run-k8s-tests-on-tdx: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: publish-kata-deploy-payload-amd64 - uses: ./.github/workflows/run-k8s-tests-on-tdx.yaml - with: - registry: ghcr.io - repo: ${{ github.repository_owner }}/kata-deploy-ci - tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 - commit-hash: ${{ env.COMMIT_HASH }} - - run-metrics-tests: - if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} - needs: build-kata-static-tarball-amd64 - uses: ./.github/workflows/run-metrics.yaml - with: - tarball-suffix: -${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }}-amd64 - commit-hash: ${{ env.COMMIT_HASH }} + tag: ${{ env.PR_NUMBER }}-${{ env.COMMIT_HASH }} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..7eb1491a50 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,81 @@ +name: Run the Kata Containers CI +on: + workflow_call: + inputs: + commit-hash: + required: true + type: string + pr-number: + required: true + type: string + tag: + required: true + type: string + +jobs: + build-kata-static-tarball-amd64: + uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml + with: + tarball-suffix: -${{ inputs.tag }} + commit-hash: ${{ inputs.commit-hash }} + + publish-kata-deploy-payload-amd64: + needs: build-kata-static-tarball-amd64 + uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml + with: + tarball-suffix: -${{ inputs.tag }} + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-amd64 + commit-hash: ${{ inputs.commit-hash }} + secrets: inherit + + run-k8s-tests-on-aks: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + needs: publish-kata-deploy-payload-amd64 + uses: ./.github/workflows/run-k8s-tests-on-aks.yaml + with: + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-amd64 + commit-hash: ${{ inputs.commit-hash }} + secrets: inherit + + run-k8s-tests-on-sev: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + needs: publish-kata-deploy-payload-amd64 + uses: ./.github/workflows/run-k8s-tests-on-sev.yaml + with: + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-amd64 + commit-hash: ${{ inputs.commit-hash }} + + run-k8s-tests-on-snp: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + needs: publish-kata-deploy-payload-amd64 + uses: ./.github/workflows/run-k8s-tests-on-snp.yaml + with: + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-amd64 + pr-number: ${{ inputs.pr-number }} + commit-hash: ${{ inputs.commit-hash }} + + run-k8s-tests-on-tdx: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + needs: publish-kata-deploy-payload-amd64 + uses: ./.github/workflows/run-k8s-tests-on-tdx.yaml + with: + registry: ghcr.io + repo: ${{ github.repository_owner }}/kata-deploy-ci + tag: ${{ inputs.tag }}-amd64 + commit-hash: ${{ inputs.commit-hash }} + + run-metrics-tests: + if: ${{ contains(github.event.pull_request.labels.*.name, 'ok-to-test') }} + needs: build-kata-static-tarball-amd64 + uses: ./.github/workflows/run-metrics.yaml + with: + tarball-suffix: -${{ inputs.tag }}-amd64 + commit-hash: ${{ inputs.commit-hash }}