Skip to content

Fix CI

Fix CI #7854

Workflow file for this run

name: Test
on:
pull_request:
paths:
- pkg/**/*
- cmd/**/*
- test/**/*
- hack/**/*
- kustomize/**/*
- go.mod
- .github/workflows/test.yaml
- '!hack/releases-helm-chart.sh'
push:
paths:
- pkg/**/*
- cmd/**/*
- test/**/*
- hack/**/*
- kustomize/**/*
- go.mod
- .github/workflows/test.yaml
- '!hack/releases-helm-chart.sh'
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
CGO_ENABLED: "0"
GO_VERSION: "1.23.0"
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
builder: docker
- os: ubuntu-latest
builder: podman
- os: ubuntu-22.04
builder: nerdctl
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Test
shell: bash
run: |
./hack/e2e-test.sh release/build
- name: Build
shell: bash
run: |
make build
- name: Install Nerdctl and Start Containerd
if: ${{ matrix.builder == 'nerdctl' }}
shell: bash
run: |
curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.7/nerdctl-full-1.7.7-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local
sudo systemctl daemon-reload
sudo systemctl enable --now containerd
containerd-rootless-setuptool.sh install
containerd-rootless-setuptool.sh install-buildkit-containerd
- name: Build Image
shell: bash
run: |
BUILDER=${{ matrix.builder }} make build-image
- name: Build Cluster Image
shell: bash
run: |
BUILDER=${{ matrix.builder }} make build-cluster-image
test-kwok-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Test e2e default
shell: bash
run: |
./hack/e2e-test.sh e2e/kwok/default
- name: Test e2e single
shell: bash
run: |
./hack/e2e-test.sh e2e/kwok/single
test-kwok:
strategy:
fail-fast: false
matrix:
case:
- kwok
continue-on-error: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Test Workable
shell: bash
run: |
./hack/e2e-test.sh ${{ matrix.case }}/${{ matrix.case }}
test-kwokctl:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
fail-fast: false
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
include:
# Windows
# Linux containers are not supported on Windows Runner
# https://github.com/orgs/community/discussions/25491#discussioncomment-3248089
- os: windows-latest
kwokctl-runtime: binary
# MacOS amd64
- os: macos-13
kwokctl-runtime: binary
# MacOS arm64
- os: macos-14
kwokctl-runtime: binary
# Linux
- os: ubuntu-latest
kwokctl-runtime: binary
- os: ubuntu-latest
kwokctl-runtime: docker
- os: ubuntu-latest
kwokctl-runtime: podman
- os: ubuntu-latest
kwokctl-runtime: kind
- os: ubuntu-latest
kwokctl-runtime: kind-podman
- os: ubuntu-22.04
kwokctl-runtime: nerdctl
continue-on-error: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install CoreUtils for MacOS
if: ${{ startsWith(matrix.os, 'macos-') }}
shell: bash
run: |
brew install coreutils bash
- name: Install Nerdctl and Start Containerd
if: ${{ matrix.kwokctl-runtime == 'nerdctl' }}
shell: bash
run: |
curl -sSL https://github.com/containerd/nerdctl/releases/download/v1.7.7/nerdctl-full-1.7.7-linux-amd64.tar.gz -o - | sudo tar -xz -C /usr/local
sudo systemctl daemon-reload
sudo systemctl enable --now containerd
containerd-rootless-setuptool.sh install
containerd-rootless-setuptool.sh install-buildkit-containerd
- name: Install kubectl
shell: bash
run: |
./hack/requirements.sh kubectl
- name: Test e2e dry run
if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }}
shell: bash
run: |
./hack/e2e-test.sh e2e/kwokctl/dryrun
- name: Test e2e
shell: bash
run: |
./hack/e2e-test.sh e2e/kwokctl/${{ matrix.kwokctl-runtime }} && rm -rf logs
- name: Test Workable
shell: bash
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" && ( "${{ matrix.kwokctl-runtime }}" == "binary" || "${{ matrix.kwokctl-runtime }}" == "docker" ) ]]; then
export LAST_RELEASE_SIZE=18
fi
./hack/e2e-test.sh kwokctl/kwokctl_${{ matrix.kwokctl-runtime }}
- name: Test Benchmark
if: ${{ matrix.os == 'ubuntu-latest' && matrix.kwokctl-runtime == 'binary' }}
shell: bash
run: |
./hack/e2e-test.sh e2e/kwokctl/benchmark
- name: Test Auto Detect
if: ${{ matrix.kwokctl-runtime == 'binary' }}
shell: bash
run: |
./hack/e2e-test.sh kwokctl/kwokctl_auto_detect
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: kwok-logs-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.kwokctl-runtime }}
path: ${{ github.workspace }}/logs