From 6e2b16d3faa29c15cf362beffabfd6e74001aa28 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Thu, 10 Oct 2024 17:10:45 +0200 Subject: [PATCH] ci(benchmarks): read secrets for running the tear-down immediately after (#14323) --- .github/workflows/benchmarks.yml | 11 +++++++++++ .github/workflows/smoke-tests-ess.yml | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index bdf4e14faf5..e0b8ffaacba 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -234,6 +234,17 @@ jobs: GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} WORKFLOW: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }} + # Secrets are rotated daily, if the benchmarks run between the rotation window, then + # there is a high chance things will stop working + # This is trying to reduce the chances of that happening. + # See https://github.com/elastic/observability-test-environments/actions/workflows/cluster-rotate-api-keys.yml + - uses: google-github-actions/get-secretmanager-secrets@95a0b09b8348ef3d02c68c6ba5662a037e78d713 # v2.1.4 + if: always() + with: + export_to_environment: true + secrets: |- + EC_API_KEY:elastic-observability/elastic-cloud-observability-team-pro-api-key + - name: Tear down benchmark environment if: always() run: make init destroy diff --git a/.github/workflows/smoke-tests-ess.yml b/.github/workflows/smoke-tests-ess.yml index 609b32b1a1f..199d076e113 100644 --- a/.github/workflows/smoke-tests-ess.yml +++ b/.github/workflows/smoke-tests-ess.yml @@ -72,6 +72,18 @@ jobs: - name: Run smoke tests ${{ matrix.test }} for ${{ matrix.version }} run: make smoketest/run-version TEST_DIR=${{ matrix.test }} SMOKETEST_VERSION=${{ matrix.version }} + + # Secrets are rotated daily, if the benchmarks run between the rotation window, then + # there is a high chance things will stop working + # This is trying to reduce the chances of that happening. + # See https://github.com/elastic/observability-test-environments/actions/workflows/cluster-rotate-api-keys.yml + - uses: google-github-actions/get-secretmanager-secrets@95a0b09b8348ef3d02c68c6ba5662a037e78d713 # v2.1.4 + if: always() + with: + export_to_environment: true + secrets: |- + EC_API_KEY:elastic-observability/elastic-cloud-observability-team-pro-api-key + - if: always() name: Teardown smoke test infra run: make smoketest/cleanup TEST_DIR=${{ matrix.test }}