Skip to content

feat: add a multi-arch image manifest bundle creation step in the image build pipeline #629

feat: add a multi-arch image manifest bundle creation step in the image build pipeline

feat: add a multi-arch image manifest bundle creation step in the image build pipeline #629

Workflow file for this run

name: Fleet Agent Compatibility Tests
on:
push:
branches:
- main
- release-*
workflow_dispatch:
inputs:
beforeTagOrCommit:
description: 'The tag or commit to build the before upgrade version of the Fleet agents from; if not specified, the latest tag will be used'
required: false
pull_request:
branches:
- main
- release-*
paths-ignore: [docs/**, "**.md", "**.mdx", "**.png", "**.jpg"]
env:
GO_VERSION: '1.24.6'
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
hub-agent-backward-compatibility:
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@v5
with:
# Fetch the history of all branches and tags.
# This is needed for the test suite to switch between releases.
fetch-depth: 0
- name: Set up Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
- name: Travel back in time to the before upgrade version
run: |
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
CURRENT_BRANCH=$(git branch --show-current)
CURRENT_BRANCH=$(git rev-parse HEAD)
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
if [ -z "${GIT_TAG}" ]
then
echo "No tag is specified; go back to the state tracked by the last known tag."
echo "Fetch all tags..."
git fetch --all
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
else
echo "A tag is specified; go back to the state tracked by the specified tag."
echo "Fetch all tags..."
git fetch --all
fi
git checkout $GIT_TAG
echo "Checked out source code at $GIT_TAG."
- name: Prepare the fleet using the before upgrade version
# Set up the Fleet using images built the older source code but with the current setup script.
#
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
# the current commit); the rest of the source code is still at the before-upgrade version.
run: |
git checkout $CURRENT_BRANCH -- test/upgrade
cd test/upgrade && chmod +x setup.sh && cd -
./test/upgrade/setup.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
HUB_SERVER_URL: 'https://172.19.0.2:6443'
- name: Travel to the current state
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
run: |
git checkout $CURRENT_BRANCH
echo "Checked out source code at $CURRENT_BRANCH."
- name: Run the Before suite
run: cd test/upgrade/before && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Upgrade the Fleet hub agent to the after upgrade version
run: |
cd test/upgrade && chmod +x upgrade.sh && cd -
UPGRADE_HUB_SIDE=true ./test/upgrade/upgrade.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Run the After suite
run: cd test/upgrade/after && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'
member-agent-backward-compatibility:
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@v5
with:
# Fetch the history of all branches and tags.
# This is needed for the test suite to switch between releases.
fetch-depth: 0
- name: Set up Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
- name: Travel back in time to the before upgrade version
run: |
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
CURRENT_BRANCH=$(git branch --show-current)
CURRENT_BRANCH=$(git rev-parse HEAD)
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
if [ -z "${GIT_TAG}" ]
then
echo "No tag is specified; go back to the state tracked by the last known tag."
echo "Fetch all tags..."
git fetch --all
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
else
echo "A tag is specified; go back to the state tracked by the specified tag."
echo "Fetch all tags..."
git fetch --all
fi
git checkout $GIT_TAG
echo "Checked out source code at $GIT_TAG."
- name: Prepare the fleet using the before upgrade version
# Set up the Fleet using images built the older source code but with the current setup script.
#
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
# the current commit); the rest of the source code is still at the before-upgrade version.
run: |
git checkout $CURRENT_BRANCH -- test/upgrade
cd test/upgrade && chmod +x setup.sh && cd -
./test/upgrade/setup.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
HUB_SERVER_URL: 'https://172.19.0.2:6443'
- name: Travel to the current state
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
run: |
git checkout $CURRENT_BRANCH
echo "Checked out source code at $CURRENT_BRANCH."
- name: Run the Before suite
run: cd test/upgrade/before && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Upgrade the Fleet member agent
run: |
cd test/upgrade && chmod +x upgrade.sh && cd -
UPGRADE_MEMBER_SIDE=true ./test/upgrade/upgrade.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Run the After suite
run: cd test/upgrade/after && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'
full-backward-compatibility:
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@v5
with:
# Fetch the history of all branches and tags.
# This is needed for the test suite to switch between releases.
fetch-depth: 0
- name: Set up Ginkgo CLI
run: |
go install github.com/onsi/ginkgo/v2/ginkgo@v2.19.1
- name: Travel back in time to the before upgrade version
run: |
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
CURRENT_BRANCH=$(git branch --show-current)
CURRENT_BRANCH=$(git rev-parse HEAD)
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
if [ -z "${GIT_TAG}" ]
then
echo "No tag is specified; go back to the state tracked by the last known tag."
echo "Fetch all tags..."
git fetch --all
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
else
echo "A tag is specified; go back to the state tracked by the specified tag."
echo "Fetch all tags..."
git fetch --all
fi
git checkout $GIT_TAG
echo "Checked out source code at $GIT_TAG."
- name: Prepare the fleet using the before upgrade version
# Set up the Fleet using images built the older source code but with the current setup script.
#
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
# the current commit); the rest of the source code is still at the before-upgrade version.
run: |
git checkout $CURRENT_BRANCH -- test/upgrade
cd test/upgrade && chmod +x setup.sh && cd -
./test/upgrade/setup.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
HUB_SERVER_URL: 'https://172.19.0.2:6443'
- name: Travel to the current state
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
run: |
git checkout $CURRENT_BRANCH
echo "Checked out source code at $CURRENT_BRANCH."
- name: Run the Before suite
run: cd test/upgrade/before && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Upgrade all Fleet agents
run: |
cd test/upgrade && chmod +x upgrade.sh && cd -
UPGRADE_HUB_SIDE=true UPGRADE_MEMBER_SIDE=true ./test/upgrade/upgrade.sh 3
env:
KUBECONFIG: '/home/runner/.kube/config'
- name: Run the After suite
run: cd test/upgrade/after && ginkgo -v -p . && cd -
env:
KUBECONFIG: '/home/runner/.kube/config'