Skip to content

Commit b6237fc

Browse files
committed
allow picking what version to test upgrade from
1 parent 5b0bca5 commit b6237fc

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

.github/actions/e2e/action.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ inputs:
3030
required: false
3131
default: "false"
3232
description: "If true it runs a provider upgrade test"
33+
upgrade_from:
34+
required: false
35+
default: ""
36+
description: "What version of the terraform provider to try upgrading from. Defaults to latest release."
3337
skip_build:
3438
required: false
3539
default: "false"
@@ -113,8 +117,14 @@ runs:
113117
if: ${{ inputs.upgrade_test == 'true' && steps.defined.outputs.defined == 'true' }}
114118
name: Upgrade test - Retrieve latest stable version
115119
run: |
116-
LATEST="$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/ClickHouse/terraform-provider-clickhouse/releases/latest | jq -r '.name')"
117-
echo "tag=$LATEST" >> "$GITHUB_OUTPUT"
120+
if [ "${{ inputs.upgrade_from }}" == "" ]
121+
then
122+
# Get latest stable release
123+
LATEST="$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/ClickHouse/terraform-provider-clickhouse/releases/latest | jq -r '.name')"
124+
echo "tag=$LATEST" >> "$GITHUB_OUTPUT"
125+
else
126+
echo "tag=${{ inputs.upgrade_from }}" >> "$GITHUB_OUTPUT"
127+
fi
118128
119129
- shell: bash
120130
if: ${{ inputs.upgrade_test == 'true' && steps.defined.outputs.defined == 'true' }}

.github/workflows/e2e.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ on:
4444
type: boolean
4545
default: false
4646
description: "If checked, additionally create service using latest stable version, then upgrade to the current version"
47+
upgrade_from:
48+
type: string
49+
default: ""
50+
description: "What version to test upgrade from"
4751
schedule:
4852
- cron: "0 7 * * *"
4953

@@ -215,6 +219,7 @@ jobs:
215219
tf_release: ${{ matrix.tf_release }}
216220
cloud_provider: ${{ matrix.test.cloud }}
217221
upgrade_test: "true"
222+
upgrade_from: ${{ inputs.upgrade_from }}
218223
skip_build: "false"
219224
region: ${{ steps.credentials.outputs.region }}
220225
aws_role_arn: ${{ secrets.AWS_ASSUME_ROLE_ARN }}

0 commit comments

Comments
 (0)