Skip to content

chore: bump the kubernetes group across 1 directory with 13 updates #5332

chore: bump the kubernetes group across 1 directory with 13 updates

chore: bump the kubernetes group across 1 directory with 13 updates #5332

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release-*
workflow_dispatch: {}
pull_request:
branches:
- main
- release-*
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]
env:
GO_VERSION: '1.25.8'
CERT_MANAGER_VERSION: 'v1.16.2'
jobs:
detect-noop:
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v5.3.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
unit-and-integration-tests:
runs-on: ubuntu-latest
needs: detect-noop
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v6.0.2
- name: Set up Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
- name: Prepare necessary environment variables
run: |
echo "CGO_ENABLED=1" >> $GITHUB_ENV
KUBEBUILDER_ASSETS=$(make --silent kubebuilder-assets-path)
echo "KUBEBUILDER_ASSETS="$KUBEBUILDER_ASSETS"" >> $GITHUB_ENV
# Certain tests that require special setup (e.g., those that should be run with Ginkgo CLI only) will
# be skipped in this step.
#
# Note that the skipping only applies to the CI environment.
- name: Run unit and integration tests with default setup & generate coverage
run: |
make test
env:
KUBEFLEET_CI_TEST_RUNNER_NAME: 'default'
# The work applier integration tests use in-memory Kubernetes environment setup; due to resource constraints
# and the way the tests are organized, running the suite with as many parallel Ginkgo processes as possible (i.e.,
# the number of all CPU cores) might not lead to the optimal outcome.
#
# Note (chenyu1): switch to test matrices if we need to test with more configuration combos in the future.
- name: Run work applier unit and integration tests with Ginkgo CLI & generate coverage
run: |
ginkgo -v -p --procs=4 --race --cover -coverprofile=work-applier-it-coverage.out ./pkg/controllers/workapplier/
KUBEFLEET_CI_WORK_APPLIER_RUN_WITH_PRIORITY_QUEUE=true ginkgo -v -p --procs=4 --race --cover -coverprofile=work-applier-it-no-pri-q-coverage.out ./pkg/controllers/workapplier/
env:
KUBEFLEET_CI_TEST_RUNNER_NAME: 'ginkgo'
- name: Upload Codecov report
uses: codecov/codecov-action@v5
with:
## Repository upload token - get it from codecov.io. Required only for private repositories
token: ${{ secrets.CODECOV_TOKEN }}
# The codecov action will auto-search all coverage files by default. All uploaded coverage will be
# merged automatically.
e2e-tests:
strategy:
fail-fast: false
matrix:
customized-settings: [default, resourceplacement, joinleave, custom]
include:
- customized-settings: default
# to shorten the test duration, set the resource snapshot creation interval to 0
resource-snapshot-creation-minimum-interval: 0m
resource-changes-collection-duration: 0m
- customized-settings: resourceplacement
# to shorten the test duration, set the resource snapshot creation interval to 0
resource-snapshot-creation-minimum-interval: 0m
resource-changes-collection-duration: 0m
- customized-settings: joinleave
# to shorten the test duration, set the resource snapshot creation interval to 0
resource-snapshot-creation-minimum-interval: 0m
resource-changes-collection-duration: 0m
- customized-settings: custom
resource-snapshot-creation-minimum-interval: 30s
resource-changes-collection-duration: 15s
runs-on: ubuntu-latest
needs: [
detect-noop,
]
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code into the Go module directory
uses: actions/checkout@v6.0.2
- name: Move Docker data directory to /mnt
# The default storage device on GitHub-hosted runners is running low during e2e tests.
# Moving Docker data directory to /mnt which has more space and is backed by a larger
# storage device.
# Upstream kubefleet repo has a much bigger default storage device and no secondary
# storage device to use.
run: |
echo "=== Moving Docker to /mnt for more disk space ==="
df -h
sudo systemctl stop docker
echo '{"data-root": "/mnt/docker"}' | sudo tee /etc/docker/daemon.json
sudo mkdir -p /mnt/docker
if [ -d "/var/lib/docker" ]; then
sudo mv /var/lib/docker/* /mnt/docker/ || true
fi
sudo systemctl start docker
echo "=== Docker moved to /mnt, verifying ==="
docker info | grep "Docker Root Dir" || true
- name: Install Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.23.4
- name: Install Kind
# Before updating the kind version to use, verify that the current kind image
# is still supported by the version.
run: |
go install sigs.k8s.io/kind@v0.30.0
- name: Run e2e tests
run: |
if [ "${{ matrix.customized-settings }}" = "default" ]; then
make e2e-tests LABEL_FILTER="!custom && !joinleave && !resourceplacement"
elif [ "${{ matrix.customized-settings }}" = "resourceplacement" ]; then
make e2e-tests LABEL_FILTER="!custom && resourceplacement"
elif [ "${{ matrix.customized-settings }}" = "joinleave" ]; then
make e2e-tests LABEL_FILTER="!custom && joinleave"
else
make e2e-tests-custom
fi
env:
KUBECONFIG: '/home/runner/.kube/config'
HUB_SERVER_URL: 'https://172.19.0.2:6443'
# Temporarily enable the AKS property provider for the E2E tests, in order
# to verify the property-based scheduling experience.
#
# TO-DO (chenyu1): to ensure a vendor-neutral experience, switch to a dummy
# property provider once the AKS one is split out.
PROPERTY_PROVIDER: 'azure'
RESOURCE_SNAPSHOT_CREATION_MINIMUM_INTERVAL: ${{ matrix.resource-snapshot-creation-minimum-interval }}
RESOURCE_CHANGES_COLLECTION_DURATION: ${{ matrix.resource-changes-collection-duration }}
CERT_MANAGER_VERSION: ${{ env.CERT_MANAGER_VERSION }}
- name: Collect logs
if: always()
# Wait for a bit before log collection; this gives the agent pods some time to shut down
# gracefully and flush their logs.
run: |
sleep 30
make collect-e2e-logs
env:
KUBECONFIG: '/home/runner/.kube/config'
LOG_DIR: 'logs-${{ matrix.customized-settings }}'
- name: Upload logs
if: always()
uses: actions/upload-artifact@v7
with:
name: e2e-logs-${{ matrix.customized-settings }}
path: test/e2e/logs-${{ matrix.customized-settings }}/
retention-days: 3