From ac721364d09520b82a86571737ada351a7c47114 Mon Sep 17 00:00:00 2001 From: hc-github-team-secure-vault-core <82990506+hc-github-team-secure-vault-core@users.noreply.github.com> Date: Mon, 3 Apr 2023 13:41:28 -0400 Subject: [PATCH] backport of commit ea130fd8a6060acb7a0103b117793bc207e26c0a (#19919) Co-authored-by: Mike Baum --- .github/workflows/test-run-enos-scenario-matrix.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/test-run-enos-scenario-matrix.yml b/.github/workflows/test-run-enos-scenario-matrix.yml index 738f1e008189..0d7d3a9fad39 100644 --- a/.github/workflows/test-run-enos-scenario-matrix.yml +++ b/.github/workflows/test-run-enos-scenario-matrix.yml @@ -104,6 +104,7 @@ jobs: ENOS_VAR_vault_revision: ${{ inputs.vault-revision }} ENOS_VAR_vault_bundle_path: ./support/downloads/${{ inputs.build-artifact-name }} ENOS_VAR_vault_license_path: ./support/vault.hclic + ENOS_DEBUG_DATA_ROOT_DIR: ./enos/support/debug-data steps: - uses: actions/checkout@v3 - uses: hashicorp/setup-terraform@v2 @@ -123,10 +124,12 @@ jobs: with: github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }} - name: Prepare scenario dependencies + id: prepare_scenario run: | mkdir -p ./enos/support/terraform-plugin-cache echo "${{ secrets.SSH_KEY_PRIVATE_CI }}" > ./enos/support/private_key.pem chmod 600 ./enos/support/private_key.pem + echo "debug_data_artifact_name=enos-debug-data_$(echo ${{ matrix.scenario }} | sed -e 's/ /_/g' | sed -e 's/:/=/g')" >> $GITHUB_OUTPUT - if: contains(inputs.matrix-file-name, 'github') uses: actions/download-artifact@v3 with: @@ -145,6 +148,14 @@ jobs: id: run_retry if: steps.run.outcome == 'failure' run: enos scenario run --timeout 60m0s --chdir ./enos ${{ matrix.scenario }} + - name: Upload Debug Data + if: failure() + uses: actions/upload-artifact@v3 + with: + # The name of the artifact is the same as the matrix scenario name with the spaces replaced with underscores and colons replaced by equals. + name: ${{ steps.prepare_scenario.outputs.debug_data_artifact_name }} + path: ${{ env.ENOS_DEBUG_DATA_ROOT_DIR }} + retention-days: 30 - name: Ensure scenario has been destroyed if: ${{ always() }} # With Enos version 0.0.11 the destroy step returns an error if the infrastructure