Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 32 additions & 4 deletions .github/workflows/enos-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: ${{ contains(matrix.filter, 'e2e_docker_base_with_worker_version') && '0' || '1' }}
fetch-tags: ${{ contains(matrix.filter, 'e2e_docker_base_with_worker_version') && 'true' || 'false' }}
- name: Determine Go version
id: get-go-version
# We use .go-version as our source of truth for current Go
Expand Down Expand Up @@ -265,12 +268,37 @@ jobs:
enos scenario check --chdir ./enos ${{ matrix.filter }} && \
enos scenario exec --chdir ./enos ${{ matrix.filter }} --cmd "version"
- name: Determine boundary version to test against previous worker version
# Get the Boundary version number and decrement the minor version by 1
# Resolve the worker version from the previous release line.
if: contains(matrix.filter, 'e2e_docker_base_with_worker_version')
run: |
version_num=$(./enos/support/boundary/boundary version | awk -F'[. ]' '/Version Number/ {print $(NF-1)}')
export ENOS_VAR_worker_version="$((version_num - 1))"
echo "ENOS_VAR_worker_version=0.$ENOS_VAR_worker_version" >> "$GITHUB_ENV"
current_version_raw=$(./enos/support/boundary/boundary version | awk '/Version Number/ {print $3}')
current_version="${current_version_raw%%[-+]*}"

if ! [[ "$current_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unable to parse Boundary version: $current_version_raw" >&2
exit 1
fi

IFS='.' read -r current_major current_minor _ <<< "$current_version"

all_semver_tags=$(git tag -l | sed 's/^v//' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || true)

previous_version=""
if [ "$current_minor" -gt 0 ]; then
target_minor=$((current_minor - 1))
previous_version=$(echo "$all_semver_tags" | grep -E "^${current_major}\.${target_minor}\.[0-9]+$" | sort -V | tail -n1 || true)
fi
if [ -z "$previous_version" ] && [ "$current_major" -gt 0 ]; then
target_major=$((current_major - 1))
previous_version=$(echo "$all_semver_tags" | grep -E "^${target_major}\.[0-9]+\.[0-9]+$" | sort -V | tail -n1 || true)
fi

if [ -z "$previous_version" ]; then
echo "No previous release line found for current version $current_version" >&2
exit 1
fi

echo "ENOS_VAR_worker_version=$previous_version" >> "$GITHUB_ENV"
- name: Run Enos scenario
id: run
# Continue once and retry
Expand Down
Loading