mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-05-17 13:04:23 +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>
97 lines
3.0 KiB
YAML
97 lines
3.0 KiB
YAML
name: CI | Run cri-containerd tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
tarball-suffix:
|
|
required: false
|
|
type: string
|
|
commit-hash:
|
|
required: false
|
|
type: string
|
|
target-branch:
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
runner:
|
|
description: The runner to execute the workflow on.
|
|
required: true
|
|
type: string
|
|
arch:
|
|
description: The arch of the tarball.
|
|
required: true
|
|
type: string
|
|
containerd_version:
|
|
description: The version of containerd for testing.
|
|
required: true
|
|
type: string
|
|
vmm:
|
|
description: The kata hypervisor for testing.
|
|
required: true
|
|
type: string
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-cri-tests-${{ toJSON(inputs) }}
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
run-cri-containerd:
|
|
name: run-cri-containerd-${{ inputs.arch }} (${{ inputs.containerd_version }}, ${{ inputs.vmm }})
|
|
runs-on: ${{ inputs.runner }}
|
|
env:
|
|
CONTAINERD_VERSION: ${{ inputs.containerd_version }}
|
|
GOPATH: ${{ github.workspace }}
|
|
KATA_HYPERVISOR: ${{ inputs.vmm }}
|
|
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: Install yq
|
|
run: |
|
|
./ci/install_yq.sh
|
|
env:
|
|
INSTALL_IN_GOPATH: false
|
|
|
|
- name: Read properties from versions.yaml
|
|
run: |
|
|
go_version="$(yq '.languages.golang.version' versions.yaml)"
|
|
[ -n "$go_version" ]
|
|
echo "GO_VERSION=${go_version}" >> "$GITHUB_ENV"
|
|
|
|
- name: Setup Golang version ${{ env.GO_VERSION }}
|
|
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
# Setup-go doesn't work properly with ppc64le: https://github.com/actions/setup-go/issues/648
|
|
architecture: ${{ inputs.arch == 'ppc64le' && 'ppc64le' || '' }}
|
|
|
|
- name: Install dependencies
|
|
timeout-minutes: 15
|
|
run: bash tests/integration/cri-containerd/gha-run.sh install-dependencies
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
- name: get-kata-tarball for ${{ inputs.arch }}
|
|
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
|
with:
|
|
name: kata-static-tarball-${{ inputs.arch }}${{ inputs.tarball-suffix }}
|
|
path: kata-artifacts
|
|
|
|
- name: Install kata
|
|
run: bash tests/integration/cri-containerd/gha-run.sh install-kata kata-artifacts
|
|
|
|
- name: Run cri-containerd tests for ${{ inputs.arch }}
|
|
timeout-minutes: 10
|
|
run: bash tests/integration/cri-containerd/gha-run.sh run
|