mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-18 05:36:24 +00:00
It is good practice to add concurrency limits to automatically cancel jobs that have been superceded and potentially stop race conditions if we try and get artifacts by workflows and job id rather than run id. See https://docs.zizmor.sh/audits/#concurrency-limits Assisted-by: IBM Bob Signed-off-by: stevenhorsman <steven@uk.ibm.com>
98 lines
2.7 KiB
YAML
98 lines
2.7 KiB
YAML
name: CI | Run kata-deploy tests
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
registry:
|
|
required: true
|
|
type: string
|
|
repo:
|
|
required: true
|
|
type: string
|
|
tag:
|
|
required: true
|
|
type: string
|
|
pr-number:
|
|
required: true
|
|
type: string
|
|
commit-hash:
|
|
required: false
|
|
type: string
|
|
target-branch:
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-kata-deploy
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
run-kata-deploy-tests:
|
|
name: run-kata-deploy-tests
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
vmm:
|
|
- qemu
|
|
k8s:
|
|
- k0s
|
|
- k3s
|
|
- rke2
|
|
- microk8s
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.job }}-${{ github.event.pull_request.number || github.ref }}-${{ toJSON(matrix) }}
|
|
cancel-in-progress: true
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
DOCKER_REGISTRY: ${{ inputs.registry }}
|
|
DOCKER_REPO: ${{ inputs.repo }}
|
|
DOCKER_TAG: ${{ inputs.tag }}
|
|
GH_PR_NUMBER: ${{ inputs.pr-number }}
|
|
KATA_HYPERVISOR: ${{ matrix.vmm }}
|
|
KUBERNETES: ${{ matrix.k8s }}
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
ref: ${{ inputs.commit-hash }}
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Rebase atop of the latest target branch
|
|
run: |
|
|
./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch"
|
|
env:
|
|
TARGET_BRANCH: ${{ inputs.target-branch }}
|
|
|
|
- name: Remove unnecessary directories to free up space
|
|
run: |
|
|
sudo rm -rf /usr/local/.ghcup
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
sudo rm -rf /usr/local/lib/android
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /usr/local/share/boost
|
|
sudo rm -rf /usr/lib/jvm
|
|
sudo rm -rf /usr/share/swift
|
|
sudo rm -rf /usr/local/share/powershell
|
|
sudo rm -rf /usr/local/julia*
|
|
sudo rm -rf /opt/az
|
|
sudo rm -rf /usr/local/share/chromium
|
|
sudo rm -rf /opt/microsoft
|
|
sudo rm -rf /opt/google
|
|
sudo rm -rf /usr/lib/firefox
|
|
|
|
- name: Deploy ${{ matrix.k8s }}
|
|
run: bash tests/functional/kata-deploy/gha-run.sh deploy-k8s
|
|
|
|
- name: Install `bats`
|
|
run: bash tests/functional/kata-deploy/gha-run.sh install-bats
|
|
|
|
- name: Run tests
|
|
run: bash tests/functional/kata-deploy/gha-run.sh run-tests
|
|
|
|
- name: Report tests
|
|
if: always()
|
|
run: bash tests/functional/kata-deploy/gha-run.sh report-tests
|