Skip to content

Test Release Candidate #261

Test Release Candidate

Test Release Candidate #261

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT
name: Test Release Candidate
env:
CWA_GITHUB_TEST_REPO_BRANCH: "main"
on:
workflow_dispatch:
inputs:
build_id:
description: 'The build ID (release candidate build number or GitHub commit SHA)'
type: string
required: true
test_repo_branch:
description: 'Override for the test repo branch (default is main)'
type: string
jobs:
OutputEnvVariables:
name: 'OutputEnvVariables'
runs-on: ubuntu-latest
outputs:
CWA_GITHUB_TEST_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
steps:
- name: SetOutputs
id: set-outputs
env:
TEST_REPO_BRANCH: ${{ inputs.test_repo_branch }}
run: |
CWA_GITHUB_TEST_REPO_BRANCH="$TEST_REPO_BRANCH"
echo "CWA_GITHUB_TEST_REPO_BRANCH=${CWA_GITHUB_TEST_REPO_BRANCH:-${{ env.CWA_GITHUB_TEST_REPO_BRANCH }}}" >> "$GITHUB_OUTPUT"
- name: Echo test variables
env:
OUT_REPO_BRANCH: ${{ steps.set-outputs.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
run: |
echo "CWA_GITHUB_TEST_REPO_BRANCH: $OUT_REPO_BRANCH"
RepackageArtifacts:
name: 'RepackageArtifacts'
uses: ./.github/workflows/repackage-release-artifacts.yml
secrets: inherit
permissions:
id-token: write
contents: read
with:
build_id: ${{ inputs.build_id }}
StartIntegrationTests:
needs: [ RepackageArtifacts, OutputEnvVariables ]
permissions:
actions: write
runs-on: ubuntu-latest
steps:
# Avoid the limit of 5 nested workflows by executing the workflow in this manner
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REF_NAME: ${{ github.ref_name }}
INPUT_BUILD_ID: ${{ inputs.build_id }}
OUT_REPO_BRANCH: ${{ needs.OutputEnvVariables.outputs.CWA_GITHUB_TEST_REPO_BRANCH }}
run: gh workflow run test-artifacts.yml --ref "$REF_NAME" --repo "$GITHUB_REPOSITORY" -f "build_id=$INPUT_BUILD_ID" -f "test_repo_branch=$OUT_REPO_BRANCH"