Skip to content

Commit

Permalink
update upgrade workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 5, 2023
1 parent b01ce1f commit 628392c
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/scheduled-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -974,11 +974,10 @@ jobs:
strategy:
fail-fast: false
matrix:
from:
- release-1.9
to:
- release-1.11
- master
case:
- release-1.9 => release-1.11
- release-1.9 => master
- release-1.11 => master
steps:
- uses: actions/checkout@v3
- uses: azure/setup-helm@v3
Expand All @@ -1002,20 +1001,27 @@ jobs:
key: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-e2e-${{ env.GO_FULL_VER }}-x86-

- name: Parse versions
run: |
version_from=$(echo ${{ matrix.case }} | awk '{print $1}')
version_to=$(echo ${{ matrix.case }} | awk '{print $3}')
echo "VERSION_FROM=$version_from" >> "$GITHUB_ENV"
echo "VERSION_TO=$version_to" >> "$GITHUB_ENV"
- name: Create branch directory
run: mkdir -p test/e2e/kube-ovn/branches/${{ matrix.from }}
run: mkdir -p test/e2e/kube-ovn/branches

- uses: actions/checkout@v3
with:
ref: ${{ matrix.from }}
ref: ${{ env.VERSION_FROM }}
fetch-depth: 1
path: test/e2e/kube-ovn/branches/${{ matrix.from }}
path: test/e2e/kube-ovn/branches/${{ env.VERSION_FROM }}

- uses: actions/checkout@v3
with:
ref: ${{ matrix.to }}
ref: ${{ env.VERSION_TO }}
fetch-depth: 1
path: test/e2e/kube-ovn/branches/${{ matrix.to }}
path: test/e2e/kube-ovn/branches/${{ env.VERSION_TO }}

- name: Install kind
uses: helm/kind-action@v1
Expand All @@ -1035,22 +1041,24 @@ jobs:
sudo chown -R $(id -un). ~/.kube/
- name: Install Kube-OVN
working-directory: test/e2e/kube-ovn/branches/${{ matrix.from }}
working-directory: test/e2e/kube-ovn/branches/${{ env.VERSION_FROM }}
run: |
version=$(grep -E '^VERSION="v([0-9]+\.){2}[0-9]+"$' dist/images/install.sh | head -n1 | awk -F= '{print $2}' | tr -d '"')
docker pull kubeovn/kube-ovn:$version
VERSION=$version make kind-install-chart
- name: Upgrade Kube-OVN
working-directory: test/e2e/kube-ovn/branches/${{ matrix.to }}
working-directory: test/e2e/kube-ovn/branches/${{ env.VERSION_TO }}
run: |
version=$(grep -E '^VERSION="v([0-9]+\.){2}[0-9]+"$' dist/images/install.sh | head -n1 | awk -F= '{print $2}' | tr -d '"')
docker pull kubeovn/kube-ovn:$version
VERSION=$version make kind-upgrade-chart
- name: Run E2E
env:
E2E_BRANCH: ${{ env.VERSION_TO }}
run: make k8s-conformance-e2e

- name: Cleanup
working-directory: test/e2e/kube-ovn/branches/${{ matrix.to }}
working-directory: test/e2e/kube-ovn/branches/${{ env.VERSION_TO }}
run: sh dist/images/cleanup.sh

0 comments on commit 628392c

Please sign in to comment.