Test Upgrade #15069
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: Test Upgrade | |
on: | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
- "**.jpg" | |
- "**.png" | |
- "**.gif" | |
- "**.svg" | |
- "adr/**" | |
- "docs/**" | |
- "CODEOWNERS" | |
merge_group: | |
paths-ignore: | |
- "**.md" | |
- "**.jpg" | |
- "**.png" | |
- "**.gif" | |
- "**.svg" | |
- "adr/**" | |
- "docs/**" | |
- "CODEOWNERS" | |
permissions: | |
contents: read | |
# Abort prior jobs in the same workflow / PR | |
concurrency: | |
group: e2e-upgrade-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-upgrade: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup golang | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version-file: go.mod | |
- name: Build PR binary and zarf init package | |
uses: ./.github/actions/packages | |
with: | |
build-examples: "false" | |
# Upload the contents of the build directory for later stages to use | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | |
with: | |
name: build-artifacts | |
path: build/ | |
retention-days: 1 | |
validate-upgrade: | |
runs-on: ubuntu-latest | |
needs: build-upgrade | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Download build artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
name: build-artifacts | |
path: build/ | |
- name: Setup golang | |
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version-file: go.mod | |
- name: Make Zarf executable | |
run: | | |
chmod +x build/zarf | |
- name: Install release version of Zarf | |
uses: defenseunicorns/setup-zarf@10e539efed02f75ec39eb8823e22a5c795f492ae #v1.0.1 | |
with: | |
download-init-package: true | |
- name: Initialize the cluster with the release version | |
# NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of zarf installed | |
# in a previous step. This test run will the current release to create a K3s cluster. | |
run: | | |
sudo env "PATH=$PATH" CI=true zarf init --components k3s,git-server --nodeport 31337 --confirm | |
# Before we run the regular tests we need to aggressively cleanup files to reduce disk pressure | |
- name: Cleanup files | |
uses: ./.github/actions/cleanup-files | |
- name: Create and deploy the upgrade test packages | |
# NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of zarf installed | |
# in a previous step. This test run will the current release to create a K3s cluster. | |
run: | | |
zarf package create src/test/upgrade --set PODINFO_VERSION=6.3.3 --confirm | |
sudo env "PATH=$PATH" CI=true zarf package deploy zarf-package-test-upgrade-package-amd64-6.3.3.tar.zst --confirm | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe deployments -n=podinfo-upgrade | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe pods -n=podinfo-upgrade | |
- name: Run tests | |
# NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of go installed | |
# in a previous step. This test run will use this PR's Zarf to create a K3s cluster. | |
run: | | |
sudo env "PATH=$PATH" CI=true APPLIANCE_MODE=true APPLIANCE_MODE_KEEP=true make test-e2e-with-cluster ARCH=amd64 | |
- name: "Describe nodes, pods and deployments" | |
# NOTE: We describe nodes, pods and deployments here to help understand failures | |
run: | | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe nodes | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe deployments -n=podinfo-upgrade | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe pods -n=podinfo-upgrade | |
# Before we run the upgrade tests we need to aggressively cleanup files to reduce disk pressure | |
- name: Cleanup files | |
uses: ./.github/actions/cleanup-files | |
- name: Run the upgrade tests | |
# NOTE: "PATH=$PATH" preserves the default user $PATH. This is needed to maintain the version of zarf installed | |
# in a previous step. This test run will the current release to create a K3s cluster. | |
run: | | |
sudo env "PATH=$PATH" CI=true zarf tools kubectl describe nodes | |
zarf package create src/test/upgrade --set PODINFO_VERSION=6.3.4 --confirm | |
sudo env "PATH=$PATH" CI=true make test-upgrade ARCH=amd64 | |
- name: Save logs | |
if: always() | |
uses: ./.github/actions/save-logs |