diff --git a/.github/actions/compare-rancher-tag/action.yaml b/.github/actions/compare-rancher-tag/action.yaml index 20fd11b51..585e804ca 100644 --- a/.github/actions/compare-rancher-tag/action.yaml +++ b/.github/actions/compare-rancher-tag/action.yaml @@ -2,12 +2,16 @@ name: Compare Rancher tag description: "Compares the latest Rancher tag for specified release lines with cached values" inputs: + cached-tag-v214: + required: true cached-tag-v213: required: true cached-tag-v212: required: true cached-tag-v211: required: true + latest-tag-v214: + required: true latest-tag-v213: required: true latest-tag-v212: @@ -15,6 +19,8 @@ inputs: latest-tag-v211: required: true outputs: + is_tag_new_v214: + value: ${{ steps.compare.outputs.is_tag_new_v214 }} is_tag_new_v213: value: ${{ steps.compare.outputs.is_tag_new_v213 }} is_tag_new_v212: @@ -26,8 +32,11 @@ runs: steps: - id: compare run: | - for RELEASE_LINE in v213 v212 v211; do - if [[ "$RELEASE_LINE" = "v213" ]]; then + for RELEASE_LINE in v214 v213 v212 v211; do + if [[ "$RELEASE_LINE" = "v214" ]]; then + TAG_INPUT="${{ inputs.latest-tag-v214 }}" + CACHED_TAG="${{ inputs.cached-tag-v214 }}" + elif [[ "$RELEASE_LINE" = "v213" ]]; then TAG_INPUT="${{ inputs.latest-tag-v213 }}" CACHED_TAG="${{ inputs.cached-tag-v213 }}" elif [[ "$RELEASE_LINE" = "v212" ]]; then @@ -50,6 +59,7 @@ runs: fi done + echo "is_tag_new_v214=$IS_TAG_NEW_v214" >> $GITHUB_OUTPUT echo "is_tag_new_v213=$IS_TAG_NEW_v213" >> $GITHUB_OUTPUT echo "is_tag_new_v212=$IS_TAG_NEW_v212" >> $GITHUB_OUTPUT echo "is_tag_new_v211=$IS_TAG_NEW_v211" >> $GITHUB_OUTPUT diff --git a/.github/actions/get-latest-rancher-tag/action.yaml b/.github/actions/get-latest-rancher-tag/action.yaml index adefcbc21..c18deb2eb 100644 --- a/.github/actions/get-latest-rancher-tag/action.yaml +++ b/.github/actions/get-latest-rancher-tag/action.yaml @@ -9,6 +9,9 @@ inputs: description: "Path to prime artifacts" required: true outputs: + lateset_tag_v214: + description: "Latest tag for v2.14" + value: ${{ steps.set-outputs.outputs.latest_tag_v214 }} latest_tag_v213: description: "Latest tag for v2.13" value: ${{ steps.set-outputs.outputs.latest_tag_v213 }} @@ -31,7 +34,7 @@ runs: echo "Latest tag for $RELEASE_LINE: $LATEST_VERSION" - if [[ "$RELEASE_LINE" == "v2.13" ]]; then + if [[ "$RELEASE_LINE" == "v2.14" || "$RELEASE_LINE" == "v2.13" ]]; then RELEASE_JSON=$(curl -s "https://api.github.com/repos/rancher/rancher/releases/tags/$LATEST_VERSION") ASSET_COUNT=$(echo "$RELEASE_JSON" | jq '.assets | length') @@ -57,6 +60,7 @@ runs: shell: bash - id: set-outputs run: | + echo "latest_tag_v214=$LATEST_TAG_v214" >> $GITHUB_OUTPUT echo "latest_tag_v213=$LATEST_TAG_v213" >> $GITHUB_OUTPUT echo "latest_tag_v212=$LATEST_TAG_v212" >> $GITHUB_OUTPUT echo "latest_tag_v211=$LATEST_TAG_v211" >> $GITHUB_OUTPUT diff --git a/.github/workflows/check-rancher-tag.yml b/.github/workflows/check-rancher-tag.yml index 8b8261b5c..4fe3ed4ff 100644 --- a/.github/workflows/check-rancher-tag.yml +++ b/.github/workflows/check-rancher-tag.yml @@ -17,12 +17,14 @@ jobs: if: github.ref == 'refs/heads/main' || github.event_name == 'schedule' runs-on: ubuntu-latest env: - RANCHER_RELEASE_LINES: "v2.13 v2.12 v2.11" - SANITIZED_RELEASES: "v213 v212 v211" + RANCHER_RELEASE_LINES: "v2.14 v2.13 v2.12 v2.11" + SANITIZED_RELEASES: "v214 v213 v212 v211" outputs: + latest_tag_v214: ${{ steps.get-latest-tag.outputs.latest_tag_v214 }} latest_tag_v213: ${{ steps.get-latest-tag.outputs.latest_tag_v213 }} latest_tag_v212: ${{ steps.get-latest-tag.outputs.latest_tag_v212 }} latest_tag_v211: ${{ steps.get-latest-tag.outputs.latest_tag_v211 }} + is_tag_new_v214: ${{ steps.compare-rancher-tag.outputs.is_tag_new_v214 }} is_tag_new_v213: ${{ steps.compare-rancher-tag.outputs.is_tag_new_v213 }} is_tag_new_v212: ${{ steps.compare-rancher-tag.outputs.is_tag_new_v212 }} is_tag_new_v211: ${{ steps.compare-rancher-tag.outputs.is_tag_new_v211 }} @@ -68,15 +70,18 @@ jobs: id: compare-rancher-tag uses: ./.github/actions/compare-rancher-tag with: + cached-tag-v214: ${{ env.CACHED_TAG_v214 }} cached-tag-v213: ${{ env.CACHED_TAG_v213 }} cached-tag-v212: ${{ env.CACHED_TAG_v212 }} cached-tag-v211: ${{ env.CACHED_TAG_v211 }} + latest-tag-v214: ${{ steps.get-latest-tag.outputs.latest_tag_v214 }} latest-tag-v213: ${{ steps.get-latest-tag.outputs.latest_tag_v213 }} latest-tag-v212: ${{ steps.get-latest-tag.outputs.latest_tag_v212 }} latest-tag-v211: ${{ steps.get-latest-tag.outputs.latest_tag_v211 }} - name: Write latest tags to files env: + LATEST_TAG_V214: ${{ steps.get-latest-tag.outputs.latest_tag_v214 }} LATEST_TAG_V213: ${{ steps.get-latest-tag.outputs.latest_tag_v213 }} LATEST_TAG_V212: ${{ steps.get-latest-tag.outputs.latest_tag_v212 }} LATEST_TAG_V211: ${{ steps.get-latest-tag.outputs.latest_tag_v211 }} @@ -97,6 +102,7 @@ jobs: needs: check-latest-rancher-tag runs-on: ubuntu-latest outputs: + chart_version_v214: ${{ steps.set-latest-chart-version.outputs.chart_version_v214 }} chart_version_v213: ${{ steps.set-latest-chart-version.outputs.chart_version_v213 }} chart_version_v212: ${{ steps.set-latest-chart-version.outputs.chart_version_v212 }} chart_version_v211: ${{ steps.set-latest-chart-version.outputs.chart_version_v211 }} @@ -105,14 +111,24 @@ jobs: - name: Chart versions id: set-latest-chart-version run: | + CHART_V214="${{ needs.check-latest-rancher-tag.outputs.latest_tag_v214 }}" CHART_V213="${{ needs.check-latest-rancher-tag.outputs.latest_tag_v213 }}" CHART_V212="${{ needs.check-latest-rancher-tag.outputs.latest_tag_v212 }}" CHART_V211="${{ needs.check-latest-rancher-tag.outputs.latest_tag_v211 }}" + echo "chart_version_v214=${CHART_V214#v}" >> $GITHUB_OUTPUT echo "chart_version_v213=${CHART_V213#v}" >> $GITHUB_OUTPUT echo "chart_version_v212=${CHART_V212#v}" >> $GITHUB_OUTPUT echo "chart_version_v211=${CHART_V211#v}" >> $GITHUB_OUTPUT + trigger-tests-v214: + needs: [check-latest-rancher-tag, set-latest-chart-version] + if: ${{ needs.check-latest-rancher-tag.outputs.is_tag_new_v214 == 'true' }} + uses: ./.github/workflows/dispatch-workflows.yml + with: + rancher_version: ${{ needs.check-latest-rancher-tag.outputs.latest_tag_v214 }} + rancher_chart_version: ${{ needs.set-latest-chart-version.outputs.chart_version_v214 }} + trigger-tests-v213: needs: [check-latest-rancher-tag, set-latest-chart-version] if: ${{ needs.check-latest-rancher-tag.outputs.is_tag_new_v213 == 'true' }} diff --git a/.github/workflows/cluster-provisioning.yml b/.github/workflows/cluster-provisioning.yml index 9af7ed9f9..6839d389a 100644 --- a/.github/workflows/cluster-provisioning.yml +++ b/.github/workflows/cluster-provisioning.yml @@ -34,6 +34,331 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "gha-prov-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || diff --git a/.github/workflows/dualstack-cluster-provisioning.yml b/.github/workflows/dualstack-cluster-provisioning.yml index 4028b1b46..0454a4c62 100644 --- a/.github/workflows/dualstack-cluster-provisioning.yml +++ b/.github/workflows/dualstack-cluster-provisioning.yml @@ -34,6 +34,311 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "gha-ds-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Dualstack Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-dualstack-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/dualstack/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || @@ -134,7 +439,6 @@ jobs: uses: ./.github/actions/get-qase-id with: triggered_tag: ${{ github.event.inputs.rancher_version }} - qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_13 }} qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_13 }} - name: Create config.yaml @@ -338,4 +642,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/dualstack-rancher-ipv6-cluster-provisioning.yml b/.github/workflows/dualstack-rancher-ipv6-cluster-provisioning.yml index e3a83f5ef..d165a708d 100644 --- a/.github/workflows/dualstack-rancher-ipv6-cluster-provisioning.yml +++ b/.github/workflows/dualstack-rancher-ipv6-cluster-provisioning.yml @@ -34,6 +34,310 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "gha6-ds-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run IPv6 Cluster Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-ipv6-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/dualstack/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || @@ -134,7 +438,6 @@ jobs: uses: ./.github/actions/get-qase-id with: triggered_tag: ${{ github.event.inputs.rancher_version }} - qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_13 }} qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_13 }} - name: Create config.yaml @@ -337,4 +640,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/ipv6-cluster-provisioning.yml b/.github/workflows/ipv6-cluster-provisioning.yml index b027ea05b..c543ed428 100644 --- a/.github/workflows/ipv6-cluster-provisioning.yml +++ b/.github/workflows/ipv6-cluster-provisioning.yml @@ -34,6 +34,312 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "gha6-prov-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_14) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_14) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run IPv6 Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-ipv6-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/ipv6/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || @@ -134,7 +440,6 @@ jobs: uses: ./.github/actions/get-qase-id with: triggered_tag: ${{ github.event.inputs.rancher_version }} - qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_13 }} qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_13 }} - name: Create config.yaml @@ -339,4 +644,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/rancher-upgrade-cluster-provisioning.yml b/.github/workflows/rancher-upgrade-cluster-provisioning.yml index eb8e594bd..5affa089c 100644 --- a/.github/workflows/rancher-upgrade-cluster-provisioning.yml +++ b/.github/workflows/rancher-upgrade-cluster-provisioning.yml @@ -34,6 +34,336 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "gha-up-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set upgraded Rancher version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set upgraded Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set upgraded Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.UPGRADED_RANCHER_VERSION }} + fallback-repo: ${{ secrets.UPGRADED_RANCHER_REPO }} + env-var-name: UPGRADED_RANCHER_REPO + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/upgraderancher/upgradeRancherServer.go + + - name: Run Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || diff --git a/.github/workflows/recurring-dualstack-tests.yml b/.github/workflows/recurring-dualstack-tests.yml index e81e59401..bd6474b7c 100644 --- a/.github/workflows/recurring-dualstack-tests.yml +++ b/.github/workflows/recurring-dualstack-tests.yml @@ -34,6 +34,323 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "gha-ds-r214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-dualstack-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/dualstack/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || diff --git a/.github/workflows/recurring-ipv6-tests.yml b/.github/workflows/recurring-ipv6-tests.yml index edda000d2..1233fe17b 100644 --- a/.github/workflows/recurring-ipv6-tests.yml +++ b/.github/workflows/recurring-ipv6-tests.yml @@ -34,6 +34,324 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "gha6-r214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-ipv6-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/ipv6/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || @@ -350,4 +668,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/recurring-tests.yml b/.github/workflows/recurring-tests.yml index 4e71a312a..523518ed0 100644 --- a/.github/workflows/recurring-tests.yml +++ b/.github/workflows/recurring-tests.yml @@ -34,6 +34,336 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14: + if: | + github.event_name == 'schedule' || + github.event.inputs.run_all_versions == 'true' || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) + name: ${{ github.event.inputs.rancher_version }} + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "gha-r214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13: if: | github.event_name == 'schedule' || diff --git a/.github/workflows/turtles-cluster-provisioning.yml b/.github/workflows/turtles-cluster-provisioning.yml index 2cd45f859..39a323f1a 100644 --- a/.github/workflows/turtles-cluster-provisioning.yml +++ b/.github/workflows/turtles-cluster-provisioning.yml @@ -4,6 +4,7 @@ name: Turtles Cluster Provisioning on: schedule: - cron: "0 12 * * 2" + - cron: "0 15 * * 2" workflow_dispatch: inputs: rancher_version: @@ -42,9 +43,1337 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14-off: + if: | + github.event.schedule == '0 15 * * 2' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'false')) + name: "[v214] turtles OFF" + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tp-off-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-on: + if: | + github.event.schedule == '0 15 * * 2' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'true')) + name: "[v214] turtles ON" + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tp-on-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-on: + if: | + github.event.schedule == '0 15 * * 2' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'toggledOn')) + name: "[v214] turtles toggled ON" + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tp-ton-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-off: + if: | + github.event.schedule == '0 15 * * 2' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'toggledOff')) + name: "[v214] turtles toggled OFF" + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tp-toff-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13-off: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 2' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -53,7 +1382,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tp-off" + HOSTNAME_PREFIX: "tp-off-213" steps: - name: Checkout repository @@ -376,7 +1705,7 @@ jobs: v2-13-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 2' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -385,7 +1714,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tp-on" + HOSTNAME_PREFIX: "tp-on-213" steps: - name: Checkout repository @@ -708,7 +2037,7 @@ jobs: v2-13-toggled-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 2' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -717,7 +2046,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tp-ton" + HOSTNAME_PREFIX: "tp-ton-213" steps: - name: Checkout repository @@ -1040,7 +2369,7 @@ jobs: v2-13-toggled-off: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 2' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -1049,7 +2378,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tp-toff" + HOSTNAME_PREFIX: "tp-toff-213" steps: - name: Checkout repository @@ -1368,4 +2697,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/turtles-rancher-upgrade-cluster-provisioning.yml b/.github/workflows/turtles-rancher-upgrade-cluster-provisioning.yml index f2abc926c..f7ec0128d 100644 --- a/.github/workflows/turtles-rancher-upgrade-cluster-provisioning.yml +++ b/.github/workflows/turtles-rancher-upgrade-cluster-provisioning.yml @@ -3,7 +3,8 @@ name: Turtles Upgraded Rancher Cluster Provisioning on: schedule: - - cron: "0 12 * * 3" + - cron: "0 12 * * 3" + - cron: "0 15 * * 3" workflow_dispatch: inputs: rancher_version: @@ -42,9 +43,1353 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14-off: + if: | + github.event.schedule == '0 15 * * 3' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.upgraded_turtles, 'false')) + name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> v2-14 - turtles OFF + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tpu-off-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set upgraded Rancher version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set upgraded Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set upgraded Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.UPGRADED_RANCHER_VERSION }} + fallback-repo: ${{ secrets.UPGRADED_RANCHER_REPO }} + env-var-name: UPGRADED_RANCHER_REPO + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/upgraderancher/upgradeRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-on: + if: | + github.event.schedule == '0 15 * * 3' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.upgraded_turtles, 'true')) + name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> v2-14 - turtles ON + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tpu-on-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set upgraded Rancher version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set upgraded Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set upgraded Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.UPGRADED_RANCHER_VERSION }} + fallback-repo: ${{ secrets.UPGRADED_RANCHER_REPO }} + env-var-name: UPGRADED_RANCHER_REPO + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/upgraderancher/upgradeRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-on: + if: | + github.event.schedule == '0 15 * * 3' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.upgraded_turtles, 'toggledOn')) + name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> v2-14 - turtles toggled ON + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tpu-ton-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set upgraded Rancher version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set upgraded Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set upgraded Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.UPGRADED_RANCHER_VERSION }} + fallback-repo: ${{ secrets.UPGRADED_RANCHER_REPO }} + env-var-name: UPGRADED_RANCHER_REPO + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/upgraderancher/upgradeRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-off: + if: | + github.event.schedule == '0 15 * * 3' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.upgraded_turtles, 'toggledOff')) + name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> v2-14 - turtles toggled OFF + runs-on: ubuntu-latest + environment: latest + env: + HOSTNAME_PREFIX: "tpu-toff-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set upgraded Rancher version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_13_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_13_HEAD) + }} + + - name: Set upgraded Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: UPGRADED_RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set upgraded Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.UPGRADED_RANCHER_VERSION }} + fallback-repo: ${{ secrets.UPGRADED_RANCHER_REPO }} + env-var-name: UPGRADED_RANCHER_REPO + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_13 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_13 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/upgraderancher/upgradeRancherServer.go + + - name: Run Turtles Provisioning tests + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + uses: ./.github/actions/run-hostbusters-provisioning + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13-off: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 3' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -53,7 +1398,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tpu-off" + HOSTNAME_PREFIX: "tpu-off-213" steps: - name: Checkout repository @@ -380,7 +1725,7 @@ jobs: v2-13-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 3' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && @@ -389,7 +1734,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tpu-on" + HOSTNAME_PREFIX: "tpu-on-213" steps: - name: Checkout repository @@ -716,7 +2061,7 @@ jobs: v2-13-toggled-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 12 * * 3' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && @@ -725,7 +2070,7 @@ jobs: runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tpu-ton" + HOSTNAME_PREFIX: "tpu-ton-213" steps: - name: Checkout repository @@ -1050,19 +2395,18 @@ jobs: slack-channel: ${{ secrets.SLACK_CHANNEL }} slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} - head-toggled-off: + v2-13-toggled-off: if: | github.event_name == 'schedule' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.upgraded_turtles, 'toggledOff')) - name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> head - turtles toggled OFF + name: ${{ vars.RELEASED_RANCHER_VERSION_2_13 }} -> v2-13 - turtles toggled OFF runs-on: ubuntu-latest environment: latest env: - HOSTNAME_PREFIX: "gha-tpu-toff" - + HOSTNAME_PREFIX: "tpu-toff-213" steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/turtles-recurring-tests.yml b/.github/workflows/turtles-recurring-tests.yml index e20b739bc..20de3b8a6 100644 --- a/.github/workflows/turtles-recurring-tests.yml +++ b/.github/workflows/turtles-recurring-tests.yml @@ -4,6 +4,7 @@ name: Turtles Recurring Runs on: schedule: - cron: "0 13 * * 1" + - cron: "0 16 * * 1" workflow_dispatch: inputs: rancher_version: @@ -42,9 +43,1357 @@ env: CLOUD_PROVIDER_VERSION: "5.95.0" jobs: + v2-14-off: + if: | + github.event.schedule == '0 16 * * 1' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'false')) + name: "[v2-14] turtles OFF" + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "trec-off-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-on: + if: | + github.event.schedule == '0 16 * * 1' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'true')) + name: "[v2-14] turtles ON" + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "trec-on-213" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-on: + if: | + github.event.schedule == '0 16 * * 1' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'toggledOn')) + name: "[v2-14] turtles toggled ON" + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "trec-ton-214" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + + v2-14-toggled-off: + if: | + github.event.schedule == '0 16 * * 1' || + github.event.inputs.run_all_versions == 'true' || + (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'head')) || + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'head')) && + (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.turtles, 'toggledOff')) + name: "[v2-14] turtles toggled OFF" + runs-on: ubuntu-latest + environment: latest + strategy: + fail-fast: false + matrix: + suite: + - rancher-server-one + - rancher-server-two + env: + HOSTNAME_PREFIX: "trec-toff-213" + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Checkout tfp-automation repository + uses: actions/checkout@v4 + with: + repository: rancher/tfp-automation + path: tfp-automation + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Get AWS credentials from Secrets Manager + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + AWS_ACCESS_KEY, ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_KEY, ${{ secrets.AWS_SECRET_ACCESS_KEY }} + + - name: "Fetch and Set DockerHub Credentials" + uses: rancher-eio/read-vault-secrets@main + with: + secrets: | + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials username | DOCKERHUB_USERNAME ; + secret/data/github/repo/${{ github.repository }}/dockerhub/org-token/credentials password | DOCKERHUB_PASSWORD + + - name: Mask Dockerhub Credentials + run: | + echo "::add-mask::${{ env.DOCKERHUB_USERNAME }}" + echo "::add-mask::${{ env.DOCKERHUB_PASSWORD }}" + + - name: Whitelist Runner IP + uses: ./.github/actions/whitelist-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set up SSH Keys + uses: ./.github/actions/setup-ssh-keys + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-private-key-name: ${{ secrets.SSH_PRIVATE_KEY_NAME }} + windows-ssh-private-key: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY }} + windows-ssh-private-key-name: ${{ secrets.WINDOWS_SSH_PRIVATE_KEY_NAME }} + + - name: Uniquify hostname prefix + uses: ./.github/actions/uniquify-hostname + + - name: Set Rancher version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_VERSION + value: | + ${{ + github.event.inputs.rancher_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_version) || + (github.event_name == 'schedule' && vars.RANCHER_VERSION_2_14_HEAD) || + (github.event.inputs.run_all_versions == 'true' && vars.RANCHER_VERSION_2_14_HEAD) + }} + + - name: Set Rancher chart version + uses: ./.github/actions/set-env-var + with: + key: RANCHER_CHART_VERSION + value: | + ${{ + github.event.inputs.rancher_chart_version || + (github.event_name == 'workflow_dispatch' && github.event.inputs.rancher_chart_version) || + (github.event_name == 'schedule' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) || + (github.event.inputs.run_all_versions == 'true' && vars.RELEASED_RANCHER_CHART_VERSION_2_13) + }} + + - name: Set Rancher repo + uses: ./.github/actions/set-rancher-repo + with: + rancher-version: ${{ env.RANCHER_VERSION }} + fallback-repo: ${{ secrets.RANCHER_REPO }} + + - name: Get Qase ID + id: get-qase-id + uses: ./.github/actions/get-qase-id + with: + triggered_tag: ${{ github.event.inputs.rancher_version }} + qase_release_id: ${{ vars.HB_QASE_RELEASE_TEST_RUN_ID_2_14 }} + qase_recurring_id: ${{ vars.HB_QASE_RECURRING_TEST_RUN_ID_2_14 }} + + - name: Create config.yaml + run: | + cat > config.yaml <> $GITHUB_ENV + shell: bash + + - name: Set up Go environment + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Build Packages + run: ./.github/scripts/go-build.sh + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + + - name: Set up Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: "${{ vars.TERRAFORM_VERSION }}" + terraform_wrapper: false + + - name: Creating Rancher server + run: go run /home/runner/work/tests/tests/validation/recurring/infrastructure/setuprancher/createRancherServer.go + + - name: Run Test Suites + env: + QASE_TEST_RUN_ID: ${{ steps.get-qase-id.outputs.id }} + QASE_AUTOMATION_TOKEN: ${{ secrets.QASE_AUTOMATION_TOKEN }} + QASE_PROJECT_ID: ${{ secrets.HB_QASE_PROJECT_ID }} + with: + suite: ${{ matrix.suite }} + uses: ./.github/actions/run-hostbusters-test-suites + + - name: Cleanup Infrastructure + if: always() + working-directory: tfp-automation/modules/sanity/aws + run: terraform destroy -auto-approve > /dev/null 2>&1 + + - name: Refresh AWS credentials + if: always() + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.IAM_ROLE }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: AWS Custodian Infrastructure Cleanup + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Node driver + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "auto-${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: AWS Custodian Downstream Cleanup - Custom + if: always() + uses: ./.github/actions/aws-cleanup + with: + prefix: "rancher-validation${{ env.HOSTNAME_PREFIX }}" + region: "${{ secrets.AWS_REGION }}" + + - name: Revoke Runner IP + if: always() + uses: ./.github/actions/revoke-runner-ip + with: + prefix-list-id: ${{ secrets.AWS_MANAGED_PREFIX_LIST_ID }} + region: "${{ secrets.AWS_REGION }}" + + - name: Set job status output + if: always() + run: echo "job_status=${{ job.status }}" >> $GITHUB_OUTPUT + id: set-job-status + + - name: Reporting Results to Slack + if: always() + uses: ./.github/actions/report-to-slack + with: + job-status: ${{ steps.set-job-status.outputs.job_status }} + slack-channel: ${{ secrets.SLACK_CHANNEL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + v2-13-off: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 13 * * 1' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -59,7 +1408,7 @@ jobs: - rancher-server-one - rancher-server-two env: - HOSTNAME_PREFIX: "gha-trec-off" + HOSTNAME_PREFIX: "trec-off-213" steps: - name: Checkout repository @@ -381,7 +1730,7 @@ jobs: v2-13-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 13 * * 1' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -396,7 +1745,7 @@ jobs: - rancher-server-one - rancher-server-two env: - HOSTNAME_PREFIX: "gha-trec-on" + HOSTNAME_PREFIX: "trec-on-213" steps: - name: Checkout repository @@ -718,7 +2067,7 @@ jobs: v2-13-toggled-on: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 13 * * 1' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -733,7 +2082,7 @@ jobs: - rancher-server-one - rancher-server-two env: - HOSTNAME_PREFIX: "gha-trec-ton" + HOSTNAME_PREFIX: "trec-ton-213" steps: - name: Checkout repository @@ -1055,7 +2404,7 @@ jobs: v2-13-toggled-off: if: | - github.event_name == 'schedule' || + github.event.schedule == '0 13 * * 1' || github.event.inputs.run_all_versions == 'true' || (github.event.inputs.run_all_variations == 'true' && startsWith(github.event.inputs.rancher_version, 'v2.13')) || (github.event_name == 'workflow_dispatch' && startsWith(github.event.inputs.rancher_version, 'v2.13')) && @@ -1070,7 +2419,7 @@ jobs: - rancher-server-one - rancher-server-two env: - HOSTNAME_PREFIX: "gha-trec-toff" + HOSTNAME_PREFIX: "trec-toff-213" steps: - name: Checkout repository @@ -1388,4 +2737,4 @@ jobs: with: job-status: ${{ steps.set-job-status.outputs.job_status }} slack-channel: ${{ secrets.SLACK_CHANNEL }} - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} \ No newline at end of file