Automated cherry pick of #6296: Update documentation link for GCP cloud provider (#6296) #16906
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Antrea upgrade | |
on: | |
pull_request: | |
branches: | |
- main | |
- release-* | |
push: | |
branches: | |
- main | |
- release-* | |
env: | |
KIND_VERSION: v0.11.1 | |
jobs: | |
check-changes: | |
name: Check whether tests need to be run based on diff | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: antrea-io/has-changes@v1 | |
id: check_diff | |
with: | |
args: docs/* ci/jenkins/* *.md hack/.notableofcontents | |
outputs: | |
has_changes: ${{ steps.check_diff.outputs.has_changes }} | |
build-antrea-image: | |
name: Build Antrea image to be used for Kind upgrade test | |
needs: check-changes | |
if: ${{ needs.check-changes.outputs.has_changes == 'yes' }} | |
runs-on: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build Antrea Docker image | |
run: | | |
./hack/build-antrea-ubuntu-all.sh --pull | |
- name: Save Antrea image to tarball | |
run: docker save -o antrea-ubuntu.tar projects.registry.vmware.com/antrea/antrea-ubuntu:latest | |
- name: Upload Antrea image for subsequent jobs | |
uses: actions/upload-artifact@v2 | |
with: | |
name: antrea-ubuntu | |
path: antrea-ubuntu.tar | |
retention-days: 1 # minimum value, in case artifact deletion by 'artifact-cleanup' job fails | |
# TODO: define an action to avoid repetition? | |
from-N-1: | |
name: Upgrade from Antrea version N-1 | |
needs: build-antrea-image | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Free disk space | |
# https://github.com/actions/virtual-environments/issues/709 | |
run: | | |
sudo apt-get clean | |
df -h | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Download Antrea image from previous job | |
uses: actions/download-artifact@v1 | |
with: | |
name: antrea-ubuntu | |
- name: Load Antrea image | |
run: docker load -i antrea-ubuntu/antrea-ubuntu.tar | |
- name: Install Kind | |
run: | | |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 | |
chmod +x ./kind | |
sudo mv kind /usr/local/bin | |
- name: Run test | |
run: | | |
mkdir log | |
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 1 | |
- name: Tar log files | |
if: ${{ failure() }} | |
run: tar -czf log.tar.gz log | |
- name: Upload test log | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: upgrade-from-antrea-version-n-1.tar.gz | |
path: log.tar.gz | |
retention-days: 30 | |
from-N-2: | |
name: Upgrade from Antrea version N-2 | |
needs: build-antrea-image | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Free disk space | |
# https://github.com/actions/virtual-environments/issues/709 | |
run: | | |
sudo apt-get clean | |
df -h | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Download Antrea image from previous job | |
uses: actions/download-artifact@v1 | |
with: | |
name: antrea-ubuntu | |
- name: Load Antrea image | |
run: docker load -i antrea-ubuntu/antrea-ubuntu.tar | |
- name: Install Kind | |
run: | | |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 | |
chmod +x ./kind | |
sudo mv kind /usr/local/bin | |
- name: Run test | |
run: | | |
mkdir log | |
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 2 | |
- name: Tar log files | |
if: ${{ failure() }} | |
run: tar -czf log.tar.gz log | |
- name: Upload test log | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: upgrade-from-antrea-version-n-2.tar.gz | |
path: log.tar.gz | |
retention-days: 30 | |
compatible-N-1: | |
name: API compatible with client version N-1 | |
needs: build-antrea-image | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Free disk space | |
# https://github.com/actions/virtual-environments/issues/709 | |
run: | | |
sudo apt-get clean | |
df -h | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Download Antrea image from previous job | |
uses: actions/download-artifact@v1 | |
with: | |
name: antrea-ubuntu | |
- name: Load Antrea image | |
run: docker load -i antrea-ubuntu/antrea-ubuntu.tar | |
- name: Install Kind | |
run: | | |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 | |
chmod +x ./kind | |
sudo mv kind /usr/local/bin | |
- name: Run test | |
run: | | |
mkdir log | |
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 1 --controller-only | |
- name: Tar log files | |
if: ${{ failure() }} | |
run: tar -czf log.tar.gz log | |
- name: Upload test log | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: api-compatible-with-client-version-n-1.tar.gz | |
path: log.tar.gz | |
retention-days: 30 | |
compatible-N-2: | |
name: API compatible with client version N-2 | |
needs: build-antrea-image | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Free disk space | |
# https://github.com/actions/virtual-environments/issues/709 | |
run: | | |
sudo apt-get clean | |
df -h | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: 1.17 | |
- name: Download Antrea image from previous job | |
uses: actions/download-artifact@v1 | |
with: | |
name: antrea-ubuntu | |
- name: Load Antrea image | |
run: docker load -i antrea-ubuntu/antrea-ubuntu.tar | |
- name: Install Kind | |
run: | | |
curl -Lo ./kind https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-$(uname)-amd64 | |
chmod +x ./kind | |
sudo mv kind /usr/local/bin | |
- name: Run test | |
run: | | |
mkdir log | |
ANTREA_LOG_DIR=$PWD/log ./ci/kind/test-upgrade-antrea.sh --from-version-n-minus 2 --controller-only | |
- name: Tar log files | |
if: ${{ failure() }} | |
run: tar -czf log.tar.gz log | |
- name: Upload test log | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: api-compatible-with-client-version-n-2.tar.gz | |
path: log.tar.gz | |
retention-days: 30 | |
# Runs after all other jobs in the workflow and deletes Antrea Docker images uploaded as temporary | |
# artifacts. It uses a third-party, MIT-licensed action (geekyeggo/delete-artifact). While Github | |
# exposes an API for deleting artifacts, they do not support an official delete-artifact action | |
# yet. | |
artifact-cleanup: | |
name: Delete uploaded images | |
needs: [build-antrea-image, from-N-1, from-N-2, compatible-N-1, compatible-N-2] | |
if: ${{ always() && needs.build-antrea-image.result == 'success' }} | |
runs-on: [ubuntu-latest] | |
steps: | |
- name: Delete antrea-ubuntu | |
if: ${{ needs.build-antrea-image.result == 'success' }} | |
uses: geekyeggo/delete-artifact@v1 | |
with: | |
name: antrea-ubuntu | |
failOnError: false |