mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-09 03:48:05 +00:00
Merge pull request #6629 from fidencio/topic/gha-refactor-run-k8s-tests-on-aks
gha: k8s-on-aks: Set {create,delete}_aks as steps
This commit is contained in:
commit
ee5dda012b
@ -2,10 +2,6 @@ name: CI | Build kata-static tarball for amd64
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -33,7 +29,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||||
- name: Build ${{ matrix.asset }}
|
- name: Build ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
@ -60,7 +56,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: get-artifacts
|
- name: get-artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -2,10 +2,6 @@ name: CI | Build kata-static tarball for arm64
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -37,7 +33,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||||
- name: Build ${{ matrix.asset }}
|
- name: Build ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
@ -68,7 +64,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: get-artifacts
|
- name: get-artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -2,10 +2,6 @@ name: CI | Build kata-static tarball for s390x
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -33,7 +29,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
fetch-depth: 0 # This is needed in order to keep the commit ids history
|
||||||
- name: Build ${{ matrix.asset }}
|
- name: Build ${{ matrix.asset }}
|
||||||
run: |
|
run: |
|
||||||
@ -65,7 +61,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: get-artifacts
|
- name: get-artifacts
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
20
.github/workflows/ci-on-push.yaml
vendored
20
.github/workflows/ci-on-push.yaml
vendored
@ -1,36 +1,30 @@
|
|||||||
name: Kata Containers CI
|
name: Kata Containers CI
|
||||||
on:
|
on:
|
||||||
workflow_run:
|
pull_request_target:
|
||||||
workflows:
|
branches:
|
||||||
- Commit Message Check
|
- 'main'
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-kata-static-tarball-amd64:
|
build-kata-static-tarball-amd64:
|
||||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
||||||
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml
|
uses: ./.github/workflows/build-kata-static-tarball-amd64.yaml
|
||||||
with:
|
with:
|
||||||
checkout-ref: ${{ github.event.workflow_run.head_sha }}
|
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.event.pull_request.head.sha }}
|
||||||
tarball-suffix: -${{ github.event.workflow_run.head_sha }}
|
|
||||||
|
|
||||||
publish-kata-deploy-payload-amd64:
|
publish-kata-deploy-payload-amd64:
|
||||||
needs: build-kata-static-tarball-amd64
|
needs: build-kata-static-tarball-amd64
|
||||||
uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml
|
uses: ./.github/workflows/publish-kata-deploy-payload-amd64.yaml
|
||||||
with:
|
with:
|
||||||
checkout-ref: ${{ github.event.workflow_run.head_sha }}
|
tarball-suffix: -${{ github.event.pull_request.number}}-${{ github.event.pull_request.head.sha }}
|
||||||
tarball-suffix: -${{ github.event.workflow_run.head_sha }}
|
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
||||||
tag: ${{ github.event.workflow_run.head_sha }}-amd64
|
tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-amd64
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
run-k8s-tests-on-aks:
|
run-k8s-tests-on-aks:
|
||||||
needs: publish-kata-deploy-payload-amd64
|
needs: publish-kata-deploy-payload-amd64
|
||||||
uses: ./.github/workflows/run-k8s-tests-on-aks.yaml
|
uses: ./.github/workflows/run-k8s-tests-on-aks.yaml
|
||||||
with:
|
with:
|
||||||
checkout-ref: ${{ github.event.workflow_run.head_sha }}
|
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
repo: ${{ github.repository_owner }}/kata-deploy-ci
|
||||||
tag: ${{ github.event.workflow_run.head_sha }}-amd64
|
tag: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-amd64
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
@ -2,10 +2,6 @@ name: CI | Publish kata-deploy payload for amd64
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -25,7 +21,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: get-kata-tarball
|
- name: get-kata-tarball
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
@ -2,10 +2,6 @@ name: CI | Publish kata-deploy payload for arm64
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -29,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: get-kata-tarball
|
- name: get-kata-tarball
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
@ -2,10 +2,6 @@ name: CI | Publish kata-deploy payload for s390x
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
tarball-suffix:
|
tarball-suffix:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
@ -29,7 +25,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: get-kata-tarball
|
- name: get-kata-tarball
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
38
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
38
.github/workflows/run-k8s-tests-on-aks.yaml
vendored
@ -2,10 +2,6 @@ name: CI | Run kubernetes tests on AKS
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
checkout-ref:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: ${{ github.sha }}
|
|
||||||
registry:
|
registry:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@ -17,18 +13,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create-aks:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
vmm:
|
|
||||||
- clh
|
|
||||||
- dragonball
|
|
||||||
- qemu
|
|
||||||
uses: ./.github/workflows/create-aks.yaml
|
|
||||||
with:
|
|
||||||
name: ${{ inputs.checkout-ref }}-${{ matrix.vmm }}-amd64
|
|
||||||
secrets: inherit
|
|
||||||
|
|
||||||
run-k8s-tests:
|
run-k8s-tests:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -38,11 +22,15 @@ jobs:
|
|||||||
- dragonball
|
- dragonball
|
||||||
- qemu
|
- qemu
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: create-aks
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Create AKS cluster to test ${{ matrix.vmm }}
|
||||||
|
uses: ./.github/workflows-create-aks.yaml
|
||||||
|
with:
|
||||||
|
name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.checkout-ref }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Install `bats`
|
- name: Install `bats`
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@ -62,7 +50,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Download credentials for the Kubernetes CLI to use them
|
- name: Download credentials for the Kubernetes CLI to use them
|
||||||
run: |
|
run: |
|
||||||
az aks get-credentials -g "kataCI" -n ${{ inputs.checkout-ref }}-${{ matrix.vmm }}-amd64
|
az aks get-credentials -g "kataCI" -n ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||||
|
|
||||||
- name: Deploy kata-deploy
|
- name: Deploy kata-deploy
|
||||||
run: |
|
run: |
|
||||||
@ -85,16 +73,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
||||||
|
|
||||||
delete-aks:
|
- name: Delete AKS cluster used to test ${{ matrix.vmm }}
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
vmm:
|
|
||||||
- clh
|
|
||||||
- dragonball
|
|
||||||
- qemu
|
|
||||||
needs: run-k8s-tests
|
|
||||||
if: always()
|
if: always()
|
||||||
uses: ./.github/workflows/delete-aks.yaml
|
uses: ./.github/workflows/delete-aks.yaml
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.checkout-ref }}-${{ matrix.vmm }}-amd64
|
name: ${{ github.event.pull_request.number }}-${{ github.event.pull_request.head.sha }}-${{ matrix.vmm }}-amd64
|
||||||
secrets: inherit
|
|
||||||
|
Loading…
Reference in New Issue
Block a user